@ni/spright-components 4.1.5 → 4.1.6

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.
@@ -60601,6 +60601,9 @@ img.ProseMirror-separator {
60601
60601
  this.availableViewportHeight = 0;
60602
60602
  this._value = '';
60603
60603
  this.forcedPosition = false;
60604
+ this.selectedOptionObserver = new MutationObserver(() => {
60605
+ this.updateDisplayValue();
60606
+ });
60604
60607
  }
60605
60608
  /**
60606
60609
  * The component is collapsible when in single-selection mode with no size attribute.
@@ -60626,6 +60629,11 @@ img.ProseMirror-separator {
60626
60629
  if (this.open) {
60627
60630
  this.initializeOpenState();
60628
60631
  }
60632
+ this.observeSelectedOptionTextContent();
60633
+ }
60634
+ disconnectedCallback() {
60635
+ super.disconnectedCallback();
60636
+ this.selectedOptionObserver?.disconnect();
60629
60637
  }
60630
60638
  get value() {
60631
60639
  Observable.track(this, 'value');
@@ -61474,6 +61482,7 @@ img.ProseMirror-separator {
61474
61482
  updateValue(shouldEmit) {
61475
61483
  if (this.$fastController.isConnected) {
61476
61484
  this.value = this.firstSelectedOption?.value ?? '';
61485
+ this.observeSelectedOptionTextContent();
61477
61486
  }
61478
61487
  if (shouldEmit) {
61479
61488
  this.$emit('input');
@@ -61524,6 +61533,20 @@ img.ProseMirror-separator {
61524
61533
  this.setPositioning();
61525
61534
  this.focusAndScrollOptionIntoView();
61526
61535
  }
61536
+ observeSelectedOptionTextContent() {
61537
+ this.selectedOptionObserver?.disconnect();
61538
+ if (this.selectedIndex === -1) {
61539
+ return;
61540
+ }
61541
+ const selectedOption = this.firstSelectedOption;
61542
+ if (selectedOption) {
61543
+ this.selectedOptionObserver?.observe(selectedOption, {
61544
+ characterData: true,
61545
+ subtree: true,
61546
+ childList: true
61547
+ });
61548
+ }
61549
+ }
61527
61550
  }
61528
61551
  __decorate$1([
61529
61552
  attr