@dartech/arsenal-ui 1.4.74 → 1.4.75
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +7 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -979,6 +979,10 @@ function ControlQueryAutocomplete(_a) {
|
|
979
979
|
const [inputValue, setInputValue] = useState('');
|
980
980
|
const [searchValue, setSearchValue] = useState('');
|
981
981
|
const [page, setPage] = useState(0);
|
982
|
+
const openPanel = useMemo(() => {
|
983
|
+
if (!options.length) return false;
|
984
|
+
return open;
|
985
|
+
}, [open, options]);
|
982
986
|
const {
|
983
987
|
data,
|
984
988
|
isFetching
|
@@ -1030,6 +1034,7 @@ function ControlQueryAutocomplete(_a) {
|
|
1030
1034
|
} else setSearchValue(val);
|
1031
1035
|
}, 500);
|
1032
1036
|
const handleInputChange = useCallback((_, value) => {
|
1037
|
+
setOptions([]);
|
1033
1038
|
setInputValue(value);
|
1034
1039
|
debouncedChange(value);
|
1035
1040
|
}, [debouncedChange]);
|
@@ -1058,7 +1063,7 @@ function ControlQueryAutocomplete(_a) {
|
|
1058
1063
|
}
|
1059
1064
|
}, [data, options]);
|
1060
1065
|
const handleOpen = () => {
|
1061
|
-
|
1066
|
+
setOpen(true);
|
1062
1067
|
};
|
1063
1068
|
const handleClose = () => {
|
1064
1069
|
setOpen(false);
|
@@ -1080,7 +1085,7 @@ function ControlQueryAutocomplete(_a) {
|
|
1080
1085
|
onChange: handleValueChange,
|
1081
1086
|
loading: isFetching,
|
1082
1087
|
clearOnBlur: false,
|
1083
|
-
open:
|
1088
|
+
open: openPanel,
|
1084
1089
|
filterOptions: x => x,
|
1085
1090
|
onOpen: handleOpen,
|
1086
1091
|
onClose: handleClose,
|