mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-02-21 01:21:21 +00:00
Fix loading options (onFocus > onDropdownVisibleChange).
onFocus is only triggered when when dropdown doesn't have focus where onDropdownVisibleChange is always triggered when opening / closing the dropdown. Closes #334.
This commit is contained in:
parent
3ec9ee2031
commit
c51653d1bc
@ -31,7 +31,11 @@ function AutoComplete({ placeholder, className, value, getOption, getOptions, on
|
||||
}
|
||||
}, [value, getOption]);
|
||||
|
||||
const onFocus = () => {
|
||||
const onVisibleChange = (open: boolean) => {
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
|
||||
getOptions("", options => {
|
||||
if (option !== undefined) {
|
||||
const selected = option.value;
|
||||
@ -63,7 +67,7 @@ function AutoComplete({ placeholder, className, value, getOption, getOptions, on
|
||||
<Select
|
||||
showSearch
|
||||
options={options}
|
||||
onFocus={onFocus}
|
||||
onDropdownVisibleChange={onVisibleChange}
|
||||
onSearch={onSearch}
|
||||
onSelect={onSelectFn}
|
||||
filterOption={false}
|
||||
|
Loading…
x
Reference in New Issue
Block a user