@carbon/react 1.63.0 → 1.63.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.
@@ -57,7 +57,10 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
57
57
  */
58
58
  disabled?: boolean;
59
59
  /**
60
- * Additional props passed to Downshift
60
+ * Additional props passed to Downshift. Use with caution: anything you define
61
+ * here overrides the components' internal handling of that prop. Downshift
62
+ * internals are subject to change, and in some cases they can not be shimmed
63
+ * to shield you from potentially breaking changes.
61
64
  */
62
65
  downshiftProps?: Partial<UseComboboxProps<ItemType>>;
63
66
  /**
@@ -329,7 +329,6 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
329
329
  toggleMenu,
330
330
  setHighlightedIndex
331
331
  } = useCombobox({
332
- ...downshiftProps,
333
332
  items: filterItems(items, itemToString, inputValue),
334
333
  inputValue: inputValue,
335
334
  itemToString: item => {
@@ -350,12 +349,28 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
350
349
  selectedItem
351
350
  });
352
351
  },
352
+ onHighlightedIndexChange: _ref5 => {
353
+ let {
354
+ highlightedIndex
355
+ } = _ref5;
356
+ if (highlightedIndex > -1 && typeof window !== undefined) {
357
+ const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
358
+ const highlightedItem = itemArray[highlightedIndex];
359
+ if (highlightedItem) {
360
+ highlightedItem.scrollIntoView({
361
+ behavior: 'smooth',
362
+ block: 'nearest'
363
+ });
364
+ }
365
+ }
366
+ },
353
367
  initialSelectedItem: initialSelectedItem,
354
368
  inputId: id,
355
369
  stateReducer,
356
370
  isItemDisabled(item, _index) {
357
371
  return item.disabled;
358
- }
372
+ },
373
+ ...downshiftProps
359
374
  });
360
375
  const buttonProps = getToggleButtonProps({
361
376
  disabled: disabled || readOnly,
@@ -571,7 +586,10 @@ ComboBox.propTypes = {
571
586
  */
572
587
  disabled: PropTypes.bool,
573
588
  /**
574
- * Additional props passed to Downshift
589
+ * Additional props passed to Downshift. Use with caution: anything you define
590
+ * here overrides the components' internal handling of that prop. Downshift
591
+ * internals are subject to change, and in some cases they can not be shimmed
592
+ * to shield you from potentially breaking changes.
575
593
  */
576
594
  downshiftProps: PropTypes.object,
577
595
  /**
@@ -36,7 +36,10 @@ export interface DropdownProps<ItemType> extends Omit<ReactAttr<HTMLDivElement>,
36
36
  */
37
37
  disabled?: boolean;
38
38
  /**
39
- * Additional props passed to Downshift
39
+ * Additional props passed to Downshift. Use with caution: anything you define
40
+ * here overrides the components' internal handling of that prop. Downshift
41
+ * internals are subject to change, and in some cases they can not be shimmed
42
+ * to shield you from potentially breaking changes.
40
43
  */
41
44
  downshiftProps?: Partial<UseSelectProps<ItemType>>;
42
45
  /**
@@ -22,10 +22,6 @@ import { useFloating, size, flip, autoUpdate } from '@floating-ui/react';
22
22
  import { ListBoxSize, ListBoxType } from '../ListBox/ListBoxPropTypes.js';
23
23
 
24
24
  const {
25
- ToggleButtonKeyDownArrowDown,
26
- ToggleButtonKeyDownArrowUp,
27
- ToggleButtonKeyDownHome,
28
- ToggleButtonKeyDownEnd,
29
25
  ItemMouseMove,
30
26
  MenuMouseLeave
31
27
  } = useSelect.stateChangeTypes;
@@ -113,7 +109,6 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
113
109
  isFluid
114
110
  } = useContext(FormContext);
115
111
  const selectProps = {
116
- ...downshiftProps,
117
112
  items,
118
113
  itemToString,
119
114
  initialSelectedItem,
@@ -122,28 +117,31 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
122
117
  isItemDisabled(item, _index) {
123
118
  const isObject = item !== null && typeof item === 'object';
124
119
  return isObject && 'disabled' in item && item.disabled === true;
125
- }
120
+ },
121
+ onHighlightedIndexChange: _ref3 => {
122
+ let {
123
+ highlightedIndex
124
+ } = _ref3;
125
+ if (highlightedIndex > -1 && typeof window !== undefined) {
126
+ const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
127
+ const highlightedItem = itemArray[highlightedIndex];
128
+ if (highlightedItem) {
129
+ highlightedItem.scrollIntoView({
130
+ behavior: 'smooth',
131
+ block: 'nearest'
132
+ });
133
+ }
134
+ }
135
+ },
136
+ ...downshiftProps
126
137
  };
127
138
  const dropdownInstanceId = useId();
128
139
  function stateReducer(state, actionAndChanges) {
129
140
  const {
130
141
  changes,
131
- props,
132
142
  type
133
143
  } = actionAndChanges;
134
- const {
135
- highlightedIndex
136
- } = changes;
137
144
  switch (type) {
138
- case ToggleButtonKeyDownArrowDown:
139
- case ToggleButtonKeyDownArrowUp:
140
- case ToggleButtonKeyDownHome:
141
- case ToggleButtonKeyDownEnd:
142
- if (highlightedIndex > -1) {
143
- const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
144
- props.scrollIntoView(itemArray[highlightedIndex]);
145
- }
146
- return changes;
147
145
  case ItemMouseMove:
148
146
  case MenuMouseLeave:
149
147
  return {
@@ -208,10 +206,10 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
208
206
  id: helperId,
209
207
  className: helperClasses
210
208
  }, helperText) : null;
211
- function onSelectedItemChange(_ref3) {
209
+ function onSelectedItemChange(_ref4) {
212
210
  let {
213
211
  selectedItem
214
- } = _ref3;
212
+ } = _ref4;
215
213
  if (onChange) {
216
214
  onChange({
217
215
  selectedItem: selectedItem ?? null
@@ -362,7 +360,10 @@ Dropdown.propTypes = {
362
360
  */
363
361
  disabled: PropTypes.bool,
364
362
  /**
365
- * Additional props passed to Downshift
363
+ * Additional props passed to Downshift. Use with caution: anything you define
364
+ * here overrides the components' internal handling of that prop. Downshift
365
+ * internals are subject to change, and in some cases they can not be shimmed
366
+ * to shield you from potentially breaking changes.
366
367
  */
367
368
  downshiftProps: PropTypes.object,
368
369
  /**
@@ -65,7 +65,10 @@ FluidMultiSelect.propTypes = {
65
65
  */
66
66
  disabled: PropTypes.bool,
67
67
  /**
68
- * Additional props passed to Downshift
68
+ * Additional props passed to Downshift. Use with caution: anything you define
69
+ * here overrides the components' internal handling of that prop. Downshift
70
+ * internals are subject to change, and in some cases they can not be shimmed
71
+ * to shield you from potentially breaking changes.
69
72
  */
70
73
  downshiftProps: PropTypes.object,
71
74
  /**
@@ -48,7 +48,10 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
48
48
  */
49
49
  disabled?: boolean;
50
50
  /**
51
- * Additional props passed to Downshift
51
+ * Additional props passed to Downshift. Use with caution: anything you define
52
+ * here overrides the components' internal handling of that prop. Downshift
53
+ * internals are subject to change, and in some cases they can not be shimmed
54
+ * to shield you from potentially breaking changes.
52
55
  */
53
56
  downshiftProps?: UseMultipleSelectionProps<ItemType>;
54
57
  /**
@@ -348,7 +348,6 @@ const FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Fi
348
348
  const {
349
349
  getDropdownProps
350
350
  } = useMultipleSelection({
351
- ...downshiftProps,
352
351
  activeIndex: highlightedIndex,
353
352
  initialSelectedItems,
354
353
  selectedItems: controlledSelectedItems,
@@ -364,7 +363,8 @@ const FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Fi
364
363
  break;
365
364
  }
366
365
  }
367
- }
366
+ },
367
+ ...downshiftProps
368
368
  });
369
369
  useEffect(() => {
370
370
  if (isOpen && !isMenuOpen) {
@@ -622,7 +622,10 @@ FilterableMultiSelect.propTypes = {
622
622
  */
623
623
  disabled: PropTypes.bool,
624
624
  /**
625
- * Additional props passed to Downshift
625
+ * Additional props passed to Downshift. Use with caution: anything you define
626
+ * here overrides the components' internal handling of that prop. Downshift
627
+ * internals are subject to change, and in some cases they can not be shimmed
628
+ * to shield you from potentially breaking changes.
626
629
  */
627
630
  // @ts-ignore
628
631
  downshiftProps: PropTypes.shape(Downshift.propTypes),
@@ -42,7 +42,10 @@ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<Item
42
42
  */
43
43
  disabled?: ListBoxProps['disabled'];
44
44
  /**
45
- * Additional props passed to Downshift
45
+ * Additional props passed to Downshift. Use with caution: anything you define
46
+ * here overrides the components' internal handling of that prop. Downshift
47
+ * internals are subject to change, and in some cases they can not be shimmed
48
+ * to shield you from potentially breaking changes.
46
49
  */
47
50
  downshiftProps?: Partial<UseSelectProps<ItemType>>;
48
51
  /**
@@ -166,7 +166,6 @@ const MultiSelect = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
166
166
  });
167
167
  }, [items]);
168
168
  const selectProps = {
169
- ...downshiftProps,
170
169
  stateReducer,
171
170
  isOpen,
172
171
  itemToString: filteredItems => {
@@ -178,7 +177,8 @@ const MultiSelect = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
178
177
  items: filteredItems,
179
178
  isItemDisabled(item, _index) {
180
179
  return item.disabled;
181
- }
180
+ },
181
+ ...downshiftProps
182
182
  };
183
183
  const {
184
184
  getToggleButtonProps,
@@ -518,7 +518,10 @@ MultiSelect.propTypes = {
518
518
  */
519
519
  disabled: PropTypes.bool,
520
520
  /**
521
- * Additional props passed to Downshift
521
+ * Additional props passed to Downshift. Use with caution: anything you define
522
+ * here overrides the components' internal handling of that prop. Downshift
523
+ * internals are subject to change, and in some cases they can not be shimmed
524
+ * to shield you from potentially breaking changes.
522
525
  */
523
526
  downshiftProps: PropTypes.object,
524
527
  /**
@@ -10,49 +10,70 @@ import setupGetInstanceId from '../tools/setupGetInstanceId.js';
10
10
  import { canUseDOM } from './environment.js';
11
11
  import { useIdPrefix } from './useIdPrefix.js';
12
12
 
13
- // This file was heavily inspired by Reach UI and their work on their auto-id
14
- const getId = setupGetInstanceId();
13
+ // This file was heavily inspired by:
14
+
15
+ // This tricks bundlers so they can't statically analyze this and produce
16
+ // compilation warnings/errors.
17
+ // https://github.com/webpack/webpack/issues/14814
18
+ // https://github.com/mui/material-ui/issues/41190
19
+ const _React = {
20
+ ...React__default
21
+ };
22
+ const instanceId = setupGetInstanceId();
15
23
  const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
16
24
  let serverHandoffCompleted = false;
25
+ const defaultId = 'id';
17
26
 
18
27
  /**
19
- * Generate a unique ID with an optional prefix prepended to it
28
+ * Generate a unique ID for React <=17 with an optional prefix prepended to it.
29
+ * This is an internal utility, not intended for public usage.
20
30
  * @param {string} [prefix]
21
31
  * @returns {string}
22
32
  */
23
- function useId() {
24
- let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
25
- const _prefix = useIdPrefix();
33
+ function useCompatibleId() {
34
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultId;
35
+ const contextPrefix = useIdPrefix();
26
36
  const [id, setId] = useState(() => {
27
37
  if (serverHandoffCompleted) {
28
- return `${_prefix ? `${_prefix}-` : ``}${prefix}-${getId()}`;
38
+ return `${contextPrefix ? `${contextPrefix}-` : ``}${prefix}-${instanceId()}`;
29
39
  }
30
40
  return null;
31
41
  });
32
42
  useIsomorphicLayoutEffect(() => {
33
43
  if (id === null) {
34
- setId(`${_prefix ? `${_prefix}-` : ``}${prefix}-${getId()}`);
44
+ setId(`${contextPrefix ? `${contextPrefix}-` : ``}${prefix}-${instanceId()}`);
35
45
  }
36
- }, [getId]);
46
+ }, [instanceId]);
37
47
  useEffect(() => {
38
48
  if (serverHandoffCompleted === false) {
39
49
  serverHandoffCompleted = true;
40
50
  }
41
51
  }, []);
42
- if (typeof React__default['useId'] === 'function') {
43
- const id = nativeReactUseId(_prefix, prefix);
44
- return id;
45
- }
46
52
  return id;
47
53
  }
48
- function nativeReactUseId(_prefix, prefix) {
49
- const getId = React__default['useId']();
50
- const id = `${_prefix ? `${_prefix}-` : ``}${prefix}-${getId}`;
51
- return id;
54
+
55
+ /**
56
+ * Generate a unique ID for React >=18 with an optional prefix prepended to it.
57
+ * This is an internal utility, not intended for public usage.
58
+ * @param {string} [prefix]
59
+ * @returns {string}
60
+ */
61
+ function useReactId() {
62
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultId;
63
+ const contextPrefix = useIdPrefix();
64
+ return `${contextPrefix ? `${contextPrefix}-` : ``}${prefix}-${_React.useId()}`;
52
65
  }
53
66
 
67
+ /**
68
+ * Uses React 18's built-in `useId()` when available, or falls back to a
69
+ * slightly less performant (requiring a double render) implementation for
70
+ * earlier React versions.
71
+ */
72
+ const useId = _React.useId ? useReactId : useCompatibleId;
73
+
54
74
  /**
55
75
  * Generate a unique id if a given `id` is not provided
76
+ * This is an internal utility, not intended for public usage.
56
77
  * @param {string|undefined} id
57
78
  * @returns {string}
58
79
  */
@@ -61,4 +82,4 @@ function useFallbackId(id) {
61
82
  return id ?? fallback;
62
83
  }
63
84
 
64
- export { useFallbackId, useId };
85
+ export { useCompatibleId, useFallbackId, useId };
@@ -57,7 +57,10 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
57
57
  */
58
58
  disabled?: boolean;
59
59
  /**
60
- * Additional props passed to Downshift
60
+ * Additional props passed to Downshift. Use with caution: anything you define
61
+ * here overrides the components' internal handling of that prop. Downshift
62
+ * internals are subject to change, and in some cases they can not be shimmed
63
+ * to shield you from potentially breaking changes.
61
64
  */
62
65
  downshiftProps?: Partial<UseComboboxProps<ItemType>>;
63
66
  /**
@@ -339,7 +339,6 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
339
339
  toggleMenu,
340
340
  setHighlightedIndex
341
341
  } = Downshift.useCombobox({
342
- ...downshiftProps,
343
342
  items: filterItems(items, itemToString, inputValue),
344
343
  inputValue: inputValue,
345
344
  itemToString: item => {
@@ -360,12 +359,28 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
360
359
  selectedItem
361
360
  });
362
361
  },
362
+ onHighlightedIndexChange: _ref5 => {
363
+ let {
364
+ highlightedIndex
365
+ } = _ref5;
366
+ if (highlightedIndex > -1 && typeof window !== undefined) {
367
+ const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
368
+ const highlightedItem = itemArray[highlightedIndex];
369
+ if (highlightedItem) {
370
+ highlightedItem.scrollIntoView({
371
+ behavior: 'smooth',
372
+ block: 'nearest'
373
+ });
374
+ }
375
+ }
376
+ },
363
377
  initialSelectedItem: initialSelectedItem,
364
378
  inputId: id,
365
379
  stateReducer,
366
380
  isItemDisabled(item, _index) {
367
381
  return item.disabled;
368
- }
382
+ },
383
+ ...downshiftProps
369
384
  });
370
385
  const buttonProps = getToggleButtonProps({
371
386
  disabled: disabled || readOnly,
@@ -581,7 +596,10 @@ ComboBox.propTypes = {
581
596
  */
582
597
  disabled: PropTypes__default["default"].bool,
583
598
  /**
584
- * Additional props passed to Downshift
599
+ * Additional props passed to Downshift. Use with caution: anything you define
600
+ * here overrides the components' internal handling of that prop. Downshift
601
+ * internals are subject to change, and in some cases they can not be shimmed
602
+ * to shield you from potentially breaking changes.
585
603
  */
586
604
  downshiftProps: PropTypes__default["default"].object,
587
605
  /**
@@ -36,7 +36,10 @@ export interface DropdownProps<ItemType> extends Omit<ReactAttr<HTMLDivElement>,
36
36
  */
37
37
  disabled?: boolean;
38
38
  /**
39
- * Additional props passed to Downshift
39
+ * Additional props passed to Downshift. Use with caution: anything you define
40
+ * here overrides the components' internal handling of that prop. Downshift
41
+ * internals are subject to change, and in some cases they can not be shimmed
42
+ * to shield you from potentially breaking changes.
40
43
  */
41
44
  downshiftProps?: Partial<UseSelectProps<ItemType>>;
42
45
  /**
@@ -32,10 +32,6 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
32
32
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
33
33
 
34
34
  const {
35
- ToggleButtonKeyDownArrowDown,
36
- ToggleButtonKeyDownArrowUp,
37
- ToggleButtonKeyDownHome,
38
- ToggleButtonKeyDownEnd,
39
35
  ItemMouseMove,
40
36
  MenuMouseLeave
41
37
  } = Downshift.useSelect.stateChangeTypes;
@@ -123,7 +119,6 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
123
119
  isFluid
124
120
  } = React.useContext(FormContext.FormContext);
125
121
  const selectProps = {
126
- ...downshiftProps,
127
122
  items,
128
123
  itemToString,
129
124
  initialSelectedItem,
@@ -132,28 +127,31 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
132
127
  isItemDisabled(item, _index) {
133
128
  const isObject = item !== null && typeof item === 'object';
134
129
  return isObject && 'disabled' in item && item.disabled === true;
135
- }
130
+ },
131
+ onHighlightedIndexChange: _ref3 => {
132
+ let {
133
+ highlightedIndex
134
+ } = _ref3;
135
+ if (highlightedIndex > -1 && typeof window !== undefined) {
136
+ const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
137
+ const highlightedItem = itemArray[highlightedIndex];
138
+ if (highlightedItem) {
139
+ highlightedItem.scrollIntoView({
140
+ behavior: 'smooth',
141
+ block: 'nearest'
142
+ });
143
+ }
144
+ }
145
+ },
146
+ ...downshiftProps
136
147
  };
137
148
  const dropdownInstanceId = useId.useId();
138
149
  function stateReducer(state, actionAndChanges) {
139
150
  const {
140
151
  changes,
141
- props,
142
152
  type
143
153
  } = actionAndChanges;
144
- const {
145
- highlightedIndex
146
- } = changes;
147
154
  switch (type) {
148
- case ToggleButtonKeyDownArrowDown:
149
- case ToggleButtonKeyDownArrowUp:
150
- case ToggleButtonKeyDownHome:
151
- case ToggleButtonKeyDownEnd:
152
- if (highlightedIndex > -1) {
153
- const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
154
- props.scrollIntoView(itemArray[highlightedIndex]);
155
- }
156
- return changes;
157
155
  case ItemMouseMove:
158
156
  case MenuMouseLeave:
159
157
  return {
@@ -218,10 +216,10 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
218
216
  id: helperId,
219
217
  className: helperClasses
220
218
  }, helperText) : null;
221
- function onSelectedItemChange(_ref3) {
219
+ function onSelectedItemChange(_ref4) {
222
220
  let {
223
221
  selectedItem
224
- } = _ref3;
222
+ } = _ref4;
225
223
  if (onChange) {
226
224
  onChange({
227
225
  selectedItem: selectedItem ?? null
@@ -372,7 +370,10 @@ Dropdown.propTypes = {
372
370
  */
373
371
  disabled: PropTypes__default["default"].bool,
374
372
  /**
375
- * Additional props passed to Downshift
373
+ * Additional props passed to Downshift. Use with caution: anything you define
374
+ * here overrides the components' internal handling of that prop. Downshift
375
+ * internals are subject to change, and in some cases they can not be shimmed
376
+ * to shield you from potentially breaking changes.
376
377
  */
377
378
  downshiftProps: PropTypes__default["default"].object,
378
379
  /**
@@ -75,7 +75,10 @@ FluidMultiSelect.propTypes = {
75
75
  */
76
76
  disabled: PropTypes__default["default"].bool,
77
77
  /**
78
- * Additional props passed to Downshift
78
+ * Additional props passed to Downshift. Use with caution: anything you define
79
+ * here overrides the components' internal handling of that prop. Downshift
80
+ * internals are subject to change, and in some cases they can not be shimmed
81
+ * to shield you from potentially breaking changes.
79
82
  */
80
83
  downshiftProps: PropTypes__default["default"].object,
81
84
  /**
@@ -48,7 +48,10 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
48
48
  */
49
49
  disabled?: boolean;
50
50
  /**
51
- * Additional props passed to Downshift
51
+ * Additional props passed to Downshift. Use with caution: anything you define
52
+ * here overrides the components' internal handling of that prop. Downshift
53
+ * internals are subject to change, and in some cases they can not be shimmed
54
+ * to shield you from potentially breaking changes.
52
55
  */
53
56
  downshiftProps?: UseMultipleSelectionProps<ItemType>;
54
57
  /**
@@ -360,7 +360,6 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
360
360
  const {
361
361
  getDropdownProps
362
362
  } = Downshift.useMultipleSelection({
363
- ...downshiftProps,
364
363
  activeIndex: highlightedIndex,
365
364
  initialSelectedItems,
366
365
  selectedItems: controlledSelectedItems,
@@ -376,7 +375,8 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
376
375
  break;
377
376
  }
378
377
  }
379
- }
378
+ },
379
+ ...downshiftProps
380
380
  });
381
381
  React.useEffect(() => {
382
382
  if (isOpen && !isMenuOpen) {
@@ -634,7 +634,10 @@ FilterableMultiSelect.propTypes = {
634
634
  */
635
635
  disabled: PropTypes__default["default"].bool,
636
636
  /**
637
- * Additional props passed to Downshift
637
+ * Additional props passed to Downshift. Use with caution: anything you define
638
+ * here overrides the components' internal handling of that prop. Downshift
639
+ * internals are subject to change, and in some cases they can not be shimmed
640
+ * to shield you from potentially breaking changes.
638
641
  */
639
642
  // @ts-ignore
640
643
  downshiftProps: PropTypes__default["default"].shape(Downshift__default["default"].propTypes),
@@ -42,7 +42,10 @@ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<Item
42
42
  */
43
43
  disabled?: ListBoxProps['disabled'];
44
44
  /**
45
- * Additional props passed to Downshift
45
+ * Additional props passed to Downshift. Use with caution: anything you define
46
+ * here overrides the components' internal handling of that prop. Downshift
47
+ * internals are subject to change, and in some cases they can not be shimmed
48
+ * to shield you from potentially breaking changes.
46
49
  */
47
50
  downshiftProps?: Partial<UseSelectProps<ItemType>>;
48
51
  /**
@@ -177,7 +177,6 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
177
177
  });
178
178
  }, [items]);
179
179
  const selectProps = {
180
- ...downshiftProps,
181
180
  stateReducer,
182
181
  isOpen,
183
182
  itemToString: filteredItems => {
@@ -189,7 +188,8 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
189
188
  items: filteredItems,
190
189
  isItemDisabled(item, _index) {
191
190
  return item.disabled;
192
- }
191
+ },
192
+ ...downshiftProps
193
193
  };
194
194
  const {
195
195
  getToggleButtonProps,
@@ -529,7 +529,10 @@ MultiSelect.propTypes = {
529
529
  */
530
530
  disabled: PropTypes__default["default"].bool,
531
531
  /**
532
- * Additional props passed to Downshift
532
+ * Additional props passed to Downshift. Use with caution: anything you define
533
+ * here overrides the components' internal handling of that prop. Downshift
534
+ * internals are subject to change, and in some cases they can not be shimmed
535
+ * to shield you from potentially breaking changes.
533
536
  */
534
537
  downshiftProps: PropTypes__default["default"].object,
535
538
  /**