@ni/nimble-components 24.1.2 → 24.1.4

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.
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Thu, 28 Mar 2024 17:10:03 GMT
16304
+ * Generated on Tue, 02 Apr 2024 16:52:55 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -21202,6 +21202,21 @@
21202
21202
  this.emitChangeIfValueUpdated();
21203
21203
  return returnValue;
21204
21204
  }
21205
+ /**
21206
+ * @internal
21207
+ */
21208
+ registerOption(option) {
21209
+ if (this.options.includes(option)) {
21210
+ return;
21211
+ }
21212
+ // Adding an option to the end, ultimately, isn't the correct
21213
+ // thing to do, as this will mean the option's index in the options,
21214
+ // at least temporarily, does not match the DOM order. However, it
21215
+ // is expected that a successive run of `slottedOptionsChanged` will
21216
+ // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'
21217
+ // for more info.
21218
+ this.options.push(option);
21219
+ }
21205
21220
  focusAndScrollOptionIntoView() {
21206
21221
  if (this.open) {
21207
21222
  super.focusAndScrollOptionIntoView();
@@ -21853,6 +21868,12 @@
21853
21868
  this.triggerAnimation();
21854
21869
  }
21855
21870
  triggerAnimation() {
21871
+ // Read the offsetHeight of the dialog to trigger a reflow. This guarantees that the browser
21872
+ // has processed the 'animating' class being removed before trying to readd it, even if the previous
21873
+ // animation has just finished. Otherwise, problems can occur. For example, trying to close the
21874
+ // drawer immediately after the opening animation ends does not actually close the drawer.
21875
+ // https://github.com/ni/nimble/issues/1994
21876
+ void this.dialog.offsetHeight;
21856
21877
  this.dialog.classList.add('animating');
21857
21878
  if (this.closing) {
21858
21879
  this.dialog.classList.add('closing');