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