@entur/dropdown 5.0.21 → 5.0.23-alpha.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.
@@ -1868,7 +1868,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1868
1868
  setShowSelectedItem(false);
1869
1869
  },
1870
1870
  onKeyDown: function onKeyDown(e) {
1871
- if (selectOnTab && e.key === 'Tab') {
1871
+ if (selectOnTab && isOpen && e.key === 'Tab') {
1872
1872
  var highlitedItem = listItems[highlightedIndex];
1873
1873
  if (highlitedItem) {
1874
1874
  // we don't want to clear selection with tab
@@ -2235,7 +2235,7 @@ var MultiSelect = function MultiSelect(_ref) {
2235
2235
  disabled: readOnly || disabled
2236
2236
  }, getInputProps(_extends({
2237
2237
  onKeyDown: function onKeyDown(e) {
2238
- if (selectOnTab && e.key === 'Tab') {
2238
+ if (selectOnTab && isOpen && e.key === 'Tab') {
2239
2239
  var highlitedItem = listItems[highlightedIndex];
2240
2240
  // we don't want to clear selection with tab
2241
2241
  if (highlitedItem) {
@@ -2376,7 +2376,7 @@ var Dropdown = function Dropdown(_ref) {
2376
2376
  }, getToggleButtonProps({
2377
2377
  id: undefined,
2378
2378
  onKeyDown: function onKeyDown(e) {
2379
- if (selectOnTab && e.key === 'Tab') {
2379
+ if (selectOnTab && isOpen && e.key === 'Tab') {
2380
2380
  // we don't want to clear selection with tab
2381
2381
  var highlitedItem = normalizedItems[highlightedIndex];
2382
2382
  if (highlitedItem) {