@visns-studio/visns-components 4.1.7 → 4.1.8
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.
|
@@ -13,15 +13,17 @@ function VisnsAsyncSelect({
|
|
|
13
13
|
}) {
|
|
14
14
|
const loadSuggestedOptions = useCallback(
|
|
15
15
|
debounce((inputValue, callback) => {
|
|
16
|
-
if (inputValue
|
|
16
|
+
if (inputValue.length >= 3) {
|
|
17
17
|
loadOptions(inputValue).then((options) => callback(options));
|
|
18
|
+
} else {
|
|
19
|
+
callback([]); // Return empty array if input is less than 3 characters
|
|
18
20
|
}
|
|
19
21
|
}, 500),
|
|
20
22
|
[]
|
|
21
23
|
);
|
|
22
24
|
|
|
23
25
|
const loadOptions = (inputValue) => {
|
|
24
|
-
if (inputValue
|
|
26
|
+
if (inputValue.length >= 3) {
|
|
25
27
|
return new Promise((resolve, reject) => {
|
|
26
28
|
let data = [];
|
|
27
29
|
|
|
@@ -68,6 +70,8 @@ function VisnsAsyncSelect({
|
|
|
68
70
|
}
|
|
69
71
|
);
|
|
70
72
|
});
|
|
73
|
+
} else {
|
|
74
|
+
return Promise.resolve([]); // Return empty array if input is less than 3 characters
|
|
71
75
|
}
|
|
72
76
|
};
|
|
73
77
|
|
package/package.json
CHANGED