@smilodon/core 1.10.1 → 1.10.2

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.
package/dist/index.js CHANGED
@@ -8147,6 +8147,11 @@ class EnhancedSelect extends HTMLElement {
8147
8147
  }
8148
8148
  this._syncClearControlState();
8149
8149
  }
8150
+ _isActivelyEditingSearchInput() {
8151
+ return this._config.searchable === true
8152
+ && this._state.isOpen
8153
+ && this._shadow.activeElement === this._input;
8154
+ }
8150
8155
  _renderOptionsWithAnimation() {
8151
8156
  // Add fade-out animation
8152
8157
  this._optionsContainer.style.opacity = '0';
@@ -8456,7 +8461,7 @@ class EnhancedSelect extends HTMLElement {
8456
8461
  const previousLength = this._state.loadedItems.length;
8457
8462
  this._rebuildItemRegistry(items);
8458
8463
  this._state.groupedItems = this._groupItemsByProperty(items);
8459
- if (!this._state.searchQuery)
8464
+ if (!this._state.searchQuery && !this._isActivelyEditingSearchInput())
8460
8465
  this._updateInputDisplay();
8461
8466
  const newLength = this._state.loadedItems.length;
8462
8467
  if (this._dataRequestCoordinator) {
@@ -8537,7 +8542,7 @@ class EnhancedSelect extends HTMLElement {
8537
8542
  this._rebuildItemRegistry(groupedItems.flatMap(group => group.options));
8538
8543
  this._state.groupedItems = groupedItems;
8539
8544
  this._renderOptions();
8540
- if (!this._state.searchQuery)
8545
+ if (!this._state.searchQuery && !this._isActivelyEditingSearchInput())
8541
8546
  this._updateInputDisplay();
8542
8547
  }
8543
8548
  /**
@@ -8753,14 +8758,16 @@ class EnhancedSelect extends HTMLElement {
8753
8758
  // Re-initialize observers in case infinite scroll was enabled/disabled
8754
8759
  this._initializeObservers();
8755
8760
  this._syncClearControlState();
8756
- this._updateInputDisplay();
8761
+ if (!this._isActivelyEditingSearchInput())
8762
+ this._updateInputDisplay();
8757
8763
  this._renderOptions();
8758
8764
  }
8759
8765
  else {
8760
8766
  this._syncInputContainerMode();
8761
8767
  this._syncMultiSelectDisplayConfig();
8762
8768
  this._syncClearControlState();
8763
- this._updateInputDisplay();
8769
+ if (!this._isActivelyEditingSearchInput())
8770
+ this._updateInputDisplay();
8764
8771
  }
8765
8772
  this._acknowledgedSearchMode = this._dataLoadingConfig.searchMode;
8766
8773
  if (this._dataLoadingConfig.protocol === 'legacy')
@@ -9573,7 +9580,9 @@ class EnhancedSelect extends HTMLElement {
9573
9580
  this._acknowledgedProjectionFailureStageForTest = null;
9574
9581
  throw new Error('Injected acknowledged projection failure after publication');
9575
9582
  }
9576
- if (!this._state.searchQuery && this._acknowledgedPendingSearchQuery === null) {
9583
+ if (!this._state.searchQuery
9584
+ && this._acknowledgedPendingSearchQuery === null
9585
+ && !this._isActivelyEditingSearchInput()) {
9577
9586
  this._updateInputDisplay();
9578
9587
  }
9579
9588
  this._syncListboxAccessibility();