@entur/dropdown 5.0.21 → 5.0.22

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.
@@ -1872,7 +1872,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1872
1872
  setShowSelectedItem(false);
1873
1873
  },
1874
1874
  onKeyDown: function onKeyDown(e) {
1875
- if (selectOnTab && e.key === 'Tab') {
1875
+ if (selectOnTab && isOpen && e.key === 'Tab') {
1876
1876
  var highlitedItem = listItems[highlightedIndex];
1877
1877
  if (highlitedItem) {
1878
1878
  // we don't want to clear selection with tab
@@ -2239,7 +2239,7 @@ var MultiSelect = function MultiSelect(_ref) {
2239
2239
  disabled: readOnly || disabled
2240
2240
  }, getInputProps(_extends({
2241
2241
  onKeyDown: function onKeyDown(e) {
2242
- if (selectOnTab && e.key === 'Tab') {
2242
+ if (selectOnTab && isOpen && e.key === 'Tab') {
2243
2243
  var highlitedItem = listItems[highlightedIndex];
2244
2244
  // we don't want to clear selection with tab
2245
2245
  if (highlitedItem) {
@@ -2380,7 +2380,7 @@ var Dropdown = function Dropdown(_ref) {
2380
2380
  }, getToggleButtonProps({
2381
2381
  id: undefined,
2382
2382
  onKeyDown: function onKeyDown(e) {
2383
- if (selectOnTab && e.key === 'Tab') {
2383
+ if (selectOnTab && isOpen && e.key === 'Tab') {
2384
2384
  // we don't want to clear selection with tab
2385
2385
  var highlitedItem = normalizedItems[highlightedIndex];
2386
2386
  if (highlitedItem) {