@ni/nimble-components 29.7.8 → 29.7.9

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.
@@ -16333,7 +16333,7 @@
16333
16333
 
16334
16334
  /**
16335
16335
  * Do not edit directly
16336
- * Generated on Mon, 08 Jul 2024 22:30:19 GMT
16336
+ * Generated on Wed, 10 Jul 2024 15:33:57 GMT
16337
16337
  */
16338
16338
 
16339
16339
  const Information100DarkUi = "#a46eff";
@@ -60074,7 +60074,7 @@ img.ProseMirror-separator {
60074
60074
  }
60075
60075
  newValue = this.firstSelectedOption?.value ?? newValue;
60076
60076
  }
60077
- if (prev !== newValue && !(this.open && this.selectedIndex < 0)) {
60077
+ if (prev !== newValue) {
60078
60078
  this._value = newValue;
60079
60079
  super.valueChanged(prev, newValue);
60080
60080
  Observable.notify(this, 'value');
@@ -60163,12 +60163,12 @@ img.ProseMirror-separator {
60163
60163
  }
60164
60164
  const previousSelectedIndex = this.selectedIndex;
60165
60165
  super.clickHandler(e);
60166
- this.open = this.collapsible && !this.open;
60167
- if (!this.open
60166
+ if (this.open
60168
60167
  && this.selectedIndex !== previousSelectedIndex
60169
60168
  && optionClicked) {
60170
60169
  this.updateValue(true);
60171
60170
  }
60171
+ this.open = this.collapsible && !this.open;
60172
60172
  }
60173
60173
  /**
60174
60174
  * Updates the value when an option's value changes.
@@ -60349,6 +60349,7 @@ img.ProseMirror-separator {
60349
60349
  return true;
60350
60350
  }
60351
60351
  let currentActiveIndex = this.openActiveIndex ?? this.selectedIndex;
60352
+ let commitValueThenClose = false;
60352
60353
  switch (key) {
60353
60354
  case keySpace: {
60354
60355
  // when dropdown is open allow user to enter a space for filter text
@@ -60375,8 +60376,13 @@ img.ProseMirror-separator {
60375
60376
  || this.filteredOptions.every(o => o.disabled)) {
60376
60377
  return false;
60377
60378
  }
60378
- this.open = !this.open;
60379
- if (!this.open) {
60379
+ if (this.open) {
60380
+ commitValueThenClose = true;
60381
+ }
60382
+ else {
60383
+ this.open = true;
60384
+ }
60385
+ if (commitValueThenClose) {
60380
60386
  this.focus();
60381
60387
  }
60382
60388
  break;
@@ -60399,11 +60405,16 @@ img.ProseMirror-separator {
60399
60405
  break;
60400
60406
  }
60401
60407
  }
60402
- if (!this.open && this.selectedIndex !== currentActiveIndex) {
60403
- this.selectedIndex = currentActiveIndex;
60408
+ if (!this.open || commitValueThenClose) {
60409
+ if (this.selectedIndex !== currentActiveIndex) {
60410
+ this.selectedIndex = currentActiveIndex;
60411
+ }
60412
+ if (initialSelectedIndex !== this.selectedIndex) {
60413
+ this.updateValue(true);
60414
+ }
60404
60415
  }
60405
- if (!this.open && initialSelectedIndex !== this.selectedIndex) {
60406
- this.updateValue(true);
60416
+ if (commitValueThenClose) {
60417
+ this.open = false;
60407
60418
  }
60408
60419
  return !(key === keyArrowDown || key === keyArrowUp);
60409
60420
  }