@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.
@@ -1664,7 +1664,10 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1664
1664
  labelClearSelectedItem = _ref$labelClearSelect === void 0 ? 'fjern valgt' : _ref$labelClearSelect,
1665
1665
  listStyle = _ref.listStyle,
1666
1666
  loadingText = _ref.loadingText,
1667
- onChange = _ref.onChange,
1667
+ _ref$onChange = _ref.onChange,
1668
+ onChange = _ref$onChange === void 0 ? function () {
1669
+ return undefined;
1670
+ } : _ref$onChange,
1668
1671
  placeholder = _ref.placeholder,
1669
1672
  prepend = _ref.prepend,
1670
1673
  _ref$readOnly = _ref.readOnly,
@@ -1742,7 +1745,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1742
1745
  if (isSpacePressedOnEmptyInput) {
1743
1746
  openMenu();
1744
1747
  if (isOpen && changes.highlightedIndex !== undefined) {
1745
- onChange == null ? void 0 : onChange(listItems[changes.highlightedIndex]);
1748
+ onChange(listItems[changes.highlightedIndex]);
1746
1749
  }
1747
1750
  }
1748
1751
  } else {
@@ -1771,7 +1774,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1771
1774
  if (!selectOnBlur) break;
1772
1775
  case Downshift.useCombobox.stateChangeTypes.InputKeyDownEnter: // eslint-disable-line no-fallthrough
1773
1776
  case Downshift.useCombobox.stateChangeTypes.ItemClick:
1774
- onChange == null ? void 0 : onChange(clickedItem != null ? clickedItem : null);
1777
+ onChange(clickedItem != null ? clickedItem : null);
1775
1778
  }
1776
1779
  },
1777
1780
  // Accessibility
@@ -1795,7 +1798,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1795
1798
  setInputValue = _useCombobox.setInputValue;
1796
1799
  var handleOnClear = function handleOnClear() {
1797
1800
  var _inputRef$current;
1798
- onChange == null ? void 0 : onChange(null);
1801
+ onChange(null);
1799
1802
  setInputValue(EMPTY_INPUT);
1800
1803
  (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus();
1801
1804
  updateListItems({
@@ -1853,7 +1856,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1853
1856
  setHideSelectedItem(true);
1854
1857
  },
1855
1858
  onKeyDown: function onKeyDown(e) {
1856
- if (selectOnTab && e.key === 'Tab') onChange == null ? void 0 : onChange(listItems[highlightedIndex]);
1859
+ if (selectOnTab && e.key === 'Tab') onChange(listItems[highlightedIndex]);
1857
1860
  },
1858
1861
  ref: inputRef
1859
1862
  })))), React.createElement(DropdownList, {