hide when Enter is pressed (#262)

This commit is contained in:
Red J Adaya 2024-08-24 00:46:04 +08:00 committed by GitHub
parent c1684d28d1
commit b9c87a0ce3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

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);

View File

@ -50,7 +50,7 @@
display: flex;
flex-direction: column;
width: 100%;
min-width: 390px;
min-width: 100px;
.label {
opacity: 0.5;

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