mirror of
https://github.com/maputnik/editor.git
synced 2026-07-25 23:37:27 +00:00
Fix dropdown closing behavior
This commit is contained in:
@@ -45,11 +45,13 @@ export default function InputAutocomplete({
|
|||||||
setInput(v)
|
setInput(v)
|
||||||
onChange(selectedItem ? selectedItem[0] : undefined)
|
onChange(selectedItem ? selectedItem[0] : undefined)
|
||||||
},
|
},
|
||||||
onInputValueChange: ({inputValue: v}) => {
|
onInputValueChange: ({inputValue: v, type}) => {
|
||||||
if (typeof v === 'string') {
|
if (typeof v === 'string') {
|
||||||
setInput(v)
|
setInput(v)
|
||||||
onChange(v === '' ? undefined : v)
|
onChange(v === '' ? undefined : v)
|
||||||
openMenu()
|
if (type === useCombobox.stateChangeTypes.InputChange) {
|
||||||
|
openMenu()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user