@automattic/vip-design-system 0.27.6 → 0.27.7
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.
|
@@ -210,6 +210,10 @@ var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
210
210
|
});
|
|
211
211
|
}, [options]);
|
|
212
212
|
var handleInputChange = (0, _react.useCallback)(function (query) {
|
|
213
|
+
if (!debounce) {
|
|
214
|
+
return onInputChange(query);
|
|
215
|
+
}
|
|
216
|
+
|
|
213
217
|
clearTimeout(debounceTimeout);
|
|
214
218
|
|
|
215
219
|
if (!query.length || query.length >= minLength) {
|
|
@@ -224,7 +228,7 @@ var FormAutocomplete = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
224
228
|
}
|
|
225
229
|
|
|
226
230
|
var data = handleTypeChange(query);
|
|
227
|
-
populateResults(data.map(function (option) {
|
|
231
|
+
populateResults(data == null ? void 0 : data.map(function (option) {
|
|
228
232
|
return optionLabel(option);
|
|
229
233
|
}));
|
|
230
234
|
}, [options, isDirty]);
|
package/package.json
CHANGED
package/src/system/Form/Input.js
CHANGED
|
@@ -168,6 +168,9 @@ const FormAutocomplete = React.forwardRef(
|
|
|
168
168
|
|
|
169
169
|
const handleInputChange = useCallback(
|
|
170
170
|
query => {
|
|
171
|
+
if ( ! debounce ) {
|
|
172
|
+
return onInputChange( query );
|
|
173
|
+
}
|
|
171
174
|
clearTimeout( debounceTimeout );
|
|
172
175
|
if ( ! query.length || query.length >= minLength ) {
|
|
173
176
|
debounceTimeout = setTimeout( () => {
|
|
@@ -184,7 +187,7 @@ const FormAutocomplete = React.forwardRef(
|
|
|
184
187
|
handleInputChange( query );
|
|
185
188
|
}
|
|
186
189
|
const data = handleTypeChange( query );
|
|
187
|
-
populateResults( data
|
|
190
|
+
populateResults( data?.map( option => optionLabel( option ) ) );
|
|
188
191
|
},
|
|
189
192
|
[ options, isDirty ]
|
|
190
193
|
);
|