@pushwoosh/dumb-components 1.1.176 → 1.1.177
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/Combobox/Combobox.js +15 -2
- package/package.json +1 -1
package/Combobox/Combobox.js
CHANGED
|
@@ -228,6 +228,17 @@ function SelectCombobox({
|
|
|
228
228
|
onReachEnd: loadMore
|
|
229
229
|
});
|
|
230
230
|
const onShellMouseDown = useShellMouseDown(inputRef, isOpen, open);
|
|
231
|
+
const toggleOpen = useCallback(() => {
|
|
232
|
+
if (isOpen) {
|
|
233
|
+
var _inputRef$current3;
|
|
234
|
+
close();
|
|
235
|
+
(_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || _inputRef$current3.blur();
|
|
236
|
+
} else {
|
|
237
|
+
var _inputRef$current4;
|
|
238
|
+
open();
|
|
239
|
+
(_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 || _inputRef$current4.focus();
|
|
240
|
+
}
|
|
241
|
+
}, [isOpen, open, close]);
|
|
231
242
|
useFieldOpenEffects({
|
|
232
243
|
isOpen,
|
|
233
244
|
open,
|
|
@@ -265,10 +276,12 @@ function SelectCombobox({
|
|
|
265
276
|
onShellMouseDown: onShellMouseDown,
|
|
266
277
|
onClose: close,
|
|
267
278
|
showClear: !!(clearable && hasValue),
|
|
279
|
+
showChevron: true,
|
|
280
|
+
onToggle: toggleOpen,
|
|
268
281
|
onClear: () => {
|
|
269
|
-
var _inputRef$
|
|
282
|
+
var _inputRef$current5;
|
|
270
283
|
onChange(null);
|
|
271
|
-
(_inputRef$
|
|
284
|
+
(_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 || _inputRef$current5.focus();
|
|
272
285
|
},
|
|
273
286
|
dropdownItems: dropdownItems,
|
|
274
287
|
emptyText: resolveDropdownText(emptyText, query),
|