hide when Enter is pressed (#262)

This commit is contained in:
Red J Adaya
2024-08-23 09:46:04 -07:00
committed by GitHub
parent c1684d28d1
commit b9c87a0ce3
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
border-radius: 6px;
position: relative;
min-height: 32px;
min-width: 200px;
min-width: 100px;
gap: 6px;
border: 2px solid var(--form-element-border-color);
background: var(--form-element-bg-color);
+1 -1
View File
@@ -50,7 +50,7 @@
display: flex;
flex-direction: column;
width: 100%;
min-width: 390px;
min-width: 100px;
.label {
opacity: 0.5;
+2 -1
View File
@@ -653,7 +653,7 @@ function PreviewView({ blockId, model }: { blockId: string; model: PreviewModel
});
return true;
}
if (keyutil.checkKeyPressed(waveEvent, "Cmd:d")) {
if (keyutil.checkKeyPressed(waveEvent, "Cmd:d") || keyutil.checkKeyPressed(waveEvent, "Enter")) {
globalStore.set(atoms.typeAheadModalAtom, {
...(typeAhead as TypeAheadModalType),
[blockId]: false,
@@ -687,6 +687,7 @@ function PreviewView({ blockId, model }: { blockId: string; model: PreviewModel
anchor={contentRef}
onKeyDown={(e) => keyutil.keydownWrapper(handleKeyDown)(e)}
onSelect={handleFileSuggestionSelect}
onSubmit={(value) => console.log(value)}
/>
)}
<div