fix(ui): prevent Enter key action during IME composition (#9564)

This commit is contained in:
drunkpiano 2026-01-21 03:01:56 +08:00 committed by GitHub
commit 156ce54362
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -77,7 +77,7 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {
}
const onKeyDown = (event: KeyboardEvent) => {
if (event.key === "Enter") {
if (event.key === "Enter" && !event.isComposing) {
event.preventDefault()
const selectedIndex = flat().findIndex((x) => props.key(x) === list.active())
const selected = flat()[selectedIndex]