react-asc 21.0.4 → 21.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.es.js +5 -10
- package/index.js +5 -10
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -411,16 +411,11 @@ const AutoComplete = (props) => {
|
|
|
411
411
|
}
|
|
412
412
|
}, [value]);
|
|
413
413
|
useEffect(() => {
|
|
414
|
-
if (options
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
setOptionsTemp([{ value: '', label: '- no entry found -' }]);
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
setOptionsTemp(optionsFiltered);
|
|
423
|
-
}
|
|
414
|
+
if (options.length === 0 && showNoEntry) {
|
|
415
|
+
setOptionsTemp([{ value: '', label: '- no entry found -' }]);
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
setOptionsTemp(options);
|
|
424
419
|
}
|
|
425
420
|
}, [options]);
|
|
426
421
|
useDebounce(() => { onChange && onChange(searchText); }, debounce, [searchText]);
|
package/index.js
CHANGED
|
@@ -419,16 +419,11 @@ const AutoComplete = (props) => {
|
|
|
419
419
|
}
|
|
420
420
|
}, [value]);
|
|
421
421
|
React.useEffect(() => {
|
|
422
|
-
if (options
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
setOptionsTemp([{ value: '', label: '- no entry found -' }]);
|
|
428
|
-
}
|
|
429
|
-
else {
|
|
430
|
-
setOptionsTemp(optionsFiltered);
|
|
431
|
-
}
|
|
422
|
+
if (options.length === 0 && showNoEntry) {
|
|
423
|
+
setOptionsTemp([{ value: '', label: '- no entry found -' }]);
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
setOptionsTemp(options);
|
|
432
427
|
}
|
|
433
428
|
}, [options]);
|
|
434
429
|
useDebounce(() => { onChange && onChange(searchText); }, debounce, [searchText]);
|