@brightspace-ui/core 2.1.0 → 2.1.1

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.
@@ -124,7 +124,12 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
124
124
  }
125
125
 
126
126
  resize() {
127
- return this._updateSize();
127
+ return new Promise(resolve => {
128
+ setTimeout(async() => {
129
+ await this._updateSize();
130
+ resolve();
131
+ }, 0);
132
+ });
128
133
  }
129
134
 
130
135
  _addHandlers() {
@@ -330,7 +335,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
330
335
  // focus first focusable child prior to auto resize (fixes screen reader hiccups)
331
336
  this._focusInitial();
332
337
 
333
- requestAnimationFrame(async() => {
338
+ setTimeout(async() => {
334
339
 
335
340
  this.shadowRoot.querySelector('.d2l-dialog-content').scrollTop = 0;
336
341
  // scrollbar is kept hidden while we update the scroll position to avoid scrollbar flash
@@ -340,6 +345,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
340
345
 
341
346
  await this._updateSize();
342
347
  this._state = 'showing';
348
+ await this._updateComplete;
343
349
 
344
350
  // edge case: no children were focused, try again after one redraw
345
351
  const activeElement = getComposedActiveElement();
@@ -354,7 +360,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
354
360
  this.dispatchEvent(new CustomEvent(
355
361
  'd2l-dialog-open', { bubbles: true, composed: true }
356
362
  ));
357
- });
363
+ }, 0);
358
364
 
359
365
  }
360
366
 
@@ -11,6 +11,15 @@ export const dialogStyles = css`
11
11
  display: block;
12
12
  }
13
13
 
14
+ :host([opened]:not([_state="showing"])) {
15
+ visibility: hidden;
16
+ }
17
+
18
+ :host([opened][_state="showing"]),
19
+ :host([opened][_state="hiding"]) {
20
+ visibility: visible;
21
+ }
22
+
14
23
  .d2l-dialog-outer {
15
24
  background-color: white;
16
25
  border: 1px solid var(--d2l-color-mica);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",