@constructor-io/constructorio-ui-autocomplete 1.23.0 → 1.23.1
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/README.md +2 -2
- package/dist/constructorio-ui-autocomplete-bundled.js +8 -8
- package/lib/cjs/hooks/useDebouncedFetchSections.js +3 -1
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/hooks/useDebouncedFetchSections.js +3 -1
- package/lib/mjs/version.js +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -54,7 +54,9 @@ const useDebouncedFetchSection = (query, cioClient, autocompleteSections, advanc
|
|
|
54
54
|
}, [autocompleteSections, advancedParameters]);
|
|
55
55
|
(0, react_1.useEffect)(() => {
|
|
56
56
|
(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
|
|
57
|
+
const trimmedTerm = debouncedSearchTerm.trim();
|
|
58
|
+
// Do not send a request if the encoded term is longer than 199 characters
|
|
59
|
+
if (trimmedTerm && encodeURIComponent(trimmedTerm).length < 200) {
|
|
58
60
|
try {
|
|
59
61
|
const response = yield (cioClient === null || cioClient === void 0 ? void 0 : cioClient.autocomplete.getAutocompleteResults(debouncedSearchTerm, autocompleteParameters));
|
|
60
62
|
if (response) {
|
package/lib/cjs/version.js
CHANGED
|
@@ -60,7 +60,9 @@ const useDebouncedFetchSection = (query, cioClient, autocompleteSections, advanc
|
|
|
60
60
|
}, [autocompleteSections, advancedParameters]);
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
(async () => {
|
|
63
|
-
|
|
63
|
+
const trimmedTerm = debouncedSearchTerm.trim();
|
|
64
|
+
// Do not send a request if the encoded term is longer than 199 characters
|
|
65
|
+
if (trimmedTerm && encodeURIComponent(trimmedTerm).length < 200) {
|
|
64
66
|
try {
|
|
65
67
|
const response = await cioClient?.autocomplete.getAutocompleteResults(debouncedSearchTerm, autocompleteParameters);
|
|
66
68
|
if (response) {
|
package/lib/mjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.23.
|
|
1
|
+
export default '1.23.1';
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.23.
|
|
1
|
+
declare const _default: "1.23.1";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED