@entur/dropdown 5.0.9 → 5.0.11

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.
@@ -1660,7 +1660,10 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1660
1660
  labelClearSelectedItem = _ref$labelClearSelect === void 0 ? 'fjern valgt' : _ref$labelClearSelect,
1661
1661
  listStyle = _ref.listStyle,
1662
1662
  loadingText = _ref.loadingText,
1663
- onChange = _ref.onChange,
1663
+ _ref$onChange = _ref.onChange,
1664
+ onChange = _ref$onChange === void 0 ? function () {
1665
+ return undefined;
1666
+ } : _ref$onChange,
1664
1667
  placeholder = _ref.placeholder,
1665
1668
  prepend = _ref.prepend,
1666
1669
  _ref$readOnly = _ref.readOnly,
@@ -1738,7 +1741,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1738
1741
  if (isSpacePressedOnEmptyInput) {
1739
1742
  openMenu();
1740
1743
  if (isOpen && changes.highlightedIndex !== undefined) {
1741
- onChange == null ? void 0 : onChange(listItems[changes.highlightedIndex]);
1744
+ onChange(listItems[changes.highlightedIndex]);
1742
1745
  }
1743
1746
  }
1744
1747
  } else {
@@ -1767,7 +1770,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1767
1770
  if (!selectOnBlur) break;
1768
1771
  case useCombobox.stateChangeTypes.InputKeyDownEnter: // eslint-disable-line no-fallthrough
1769
1772
  case useCombobox.stateChangeTypes.ItemClick:
1770
- onChange == null ? void 0 : onChange(clickedItem != null ? clickedItem : null);
1773
+ onChange(clickedItem != null ? clickedItem : null);
1771
1774
  }
1772
1775
  },
1773
1776
  // Accessibility
@@ -1791,7 +1794,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1791
1794
  setInputValue = _useCombobox.setInputValue;
1792
1795
  var handleOnClear = function handleOnClear() {
1793
1796
  var _inputRef$current;
1794
- onChange == null ? void 0 : onChange(null);
1797
+ onChange(null);
1795
1798
  setInputValue(EMPTY_INPUT);
1796
1799
  (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
1797
1800
  updateListItems({
@@ -1849,7 +1852,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1849
1852
  setHideSelectedItem(true);
1850
1853
  },
1851
1854
  onKeyDown: function onKeyDown(e) {
1852
- if (selectOnTab && e.key === 'Tab') onChange == null ? void 0 : onChange(listItems[highlightedIndex]);
1855
+ if (selectOnTab && e.key === 'Tab') onChange(listItems[highlightedIndex]);
1853
1856
  },
1854
1857
  ref: inputRef
1855
1858
  })))), React.createElement(DropdownList, {