@entur/dropdown 7.2.2 → 7.2.3-beta.0

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.
@@ -880,7 +880,7 @@ function getA11yStatusMessage(options) {
880
880
 
881
881
  var _excluded$3 = ["ariaLabelChosenSingular", "ariaLabelCloseList", "ariaLabelOpenList", "ariaLabelSelectedItem", "className", "clearable", "debounceTimeout", "disabled", "disableLabelAnimation", "feedback", "items", "itemFilter", "label", "labelClearSelectedItem", "labelTooltip", "listStyle", "loading", "loadingText", "noMatchesText", "onChange", "placeholder", "prepend", "readOnly", "selectedItem", "selectOnBlur", "selectOnTab", "style", "variant"];
882
882
  var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
883
- var _document, _getInputProps2, _selectedItem$label;
883
+ var _document, _selectedItem$label;
884
884
  var ariaLabelChosenSingular = _ref.ariaLabelChosenSingular,
885
885
  _ref$ariaLabelCloseLi = _ref.ariaLabelCloseList,
886
886
  ariaLabelCloseList = _ref$ariaLabelCloseLi === void 0 ? 'Lukk liste med valg' : _ref$ariaLabelCloseLi,
@@ -1118,9 +1118,6 @@ var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1118
1118
  labelId: getLabelProps().id,
1119
1119
  labelProps: getLabelProps(),
1120
1120
  labelTooltip: labelTooltip,
1121
- onBlur: function onBlur() {
1122
- return setInputValue('');
1123
- },
1124
1121
  onClick: function onClick(e) {
1125
1122
  if (e.target === e.currentTarget) {
1126
1123
  var _getInputProps;
@@ -1157,7 +1154,13 @@ var SearchableDropdown = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1157
1154
  className: classNames('eds-dropdown--searchable__selected-item', {
1158
1155
  'eds-dropdown--searchable__selected-item--hidden': !showSelectedItem
1159
1156
  }),
1160
- onClick: readOnly ? undefined : (_getInputProps2 = getInputProps()) == null ? void 0 : _getInputProps2.onClick,
1157
+ onClick: function onClick(event) {
1158
+ if (!disabled && !readOnly) {
1159
+ var _inputRef$current2, _getInputProps2;
1160
+ (_inputRef$current2 = inputRef.current) == null || _inputRef$current2.focus();
1161
+ (_getInputProps2 = getInputProps()) == null || _getInputProps2.onClick == null || _getInputProps2.onClick(event);
1162
+ }
1163
+ },
1161
1164
  tabIndex: readOnly ? 0 : -1
1162
1165
  }, showSelectedItem ? selectedItem == null ? void 0 : selectedItem.label : ''), React.createElement("input", _extends({
1163
1166
  className: classNames('eds-dropdown__input eds-form-control', {