Fix dropdown closing behavior

This commit is contained in:
Bart Louwers
2025-07-05 01:58:47 +02:00
parent fa0062244a
commit efe9feb9f5

View File

@@ -45,11 +45,13 @@ export default function InputAutocomplete({
setInput(v)
onChange(selectedItem ? selectedItem[0] : undefined)
},
onInputValueChange: ({inputValue: v}) => {
onInputValueChange: ({inputValue: v, type}) => {
if (typeof v === 'string') {
setInput(v)
onChange(v === '' ? undefined : v)
openMenu()
if (type === useCombobox.stateChangeTypes.InputChange) {
openMenu()
}
}
},
})