mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-16 14:28:14 +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:
@ -31,7 +31,11 @@ function AutoComplete({ placeholder, className, value, getOption, getOptions, on
|
|||||||
}
|
}
|
||||||
}, [value, getOption]);
|
}, [value, getOption]);
|
||||||
|
|
||||||
const onFocus = () => {
|
const onVisibleChange = (open: boolean) => {
|
||||||
|
if (!open) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
getOptions("", options => {
|
getOptions("", options => {
|
||||||
if (option !== undefined) {
|
if (option !== undefined) {
|
||||||
const selected = option.value;
|
const selected = option.value;
|
||||||
@ -63,7 +67,7 @@ function AutoComplete({ placeholder, className, value, getOption, getOptions, on
|
|||||||
<Select
|
<Select
|
||||||
showSearch
|
showSearch
|
||||||
options={options}
|
options={options}
|
||||||
onFocus={onFocus}
|
onDropdownVisibleChange={onVisibleChange}
|
||||||
onSearch={onSearch}
|
onSearch={onSearch}
|
||||||
onSelect={onSelectFn}
|
onSelect={onSelectFn}
|
||||||
filterOption={false}
|
filterOption={false}
|
||||||
|
Reference in New Issue
Block a user