fix tag autocomplete list not hiding on blur

This commit is contained in:
2025-05-21 15:54:51 +01:00
parent 8b82dd1408
commit bc8856d60f

View File

@@ -53,6 +53,7 @@ function AddBookmarkDialog() {
}, },
Escape: () => { Escape: () => {
linkInputRef.current?.blur() linkInputRef.current?.blur()
tagsInputRef.current?.blur()
}, },
}, },
{ ignore: () => false }, { ignore: () => false },
@@ -158,7 +159,6 @@ function TagsInput({ ref }: { ref: React.Ref<HTMLInputElement | null> }) {
}, },
}), }),
], ],
open: isInputFocused && lastTag !== "",
}) })
useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(ref, () => refs.reference.current) useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(ref, () => refs.reference.current)
@@ -183,7 +183,7 @@ function TagsInput({ ref }: { ref: React.Ref<HTMLInputElement | null> }) {
}} }}
labelClassName="bg-stone-300 dark:bg-stone-800" labelClassName="bg-stone-300 dark:bg-stone-800"
/> />
<TagList ref={refs.setFloating} style={floatingStyles} /> {isInputFocused && lastTag !== "" ? <TagList ref={refs.setFloating} style={floatingStyles} /> : null}
</> </>
) )
} }