@brightspace-ui/core 3.257.0 → 3.257.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.
@@ -5,7 +5,6 @@ import { clearDismissible, setDismissible } from '../../helpers/dismissible.js';
5
5
  import { findComposedAncestor, getComposedChildren, isComposedAncestor } from '../../helpers/dom.js';
6
6
  import { getComposedActiveElement, getFirstFocusableDescendant, getFirstFocusableRelative, getNextFocusable, isFocusable } from '../../helpers/focus.js';
7
7
  import { classMap } from 'lit/directives/class-map.js';
8
- import { getFlag } from '../../helpers/flags.js';
9
8
  import { getUniqueId } from '../../helpers/uniqueId.js';
10
9
  import { html } from 'lit';
11
10
  import { ifDefined } from 'lit/directives/if-defined.js';
@@ -26,8 +25,6 @@ const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
26
25
  const abortAction = 'abort';
27
26
  const defaultMargin = { top: 75, right: 30, bottom: 30, left: 30 };
28
27
 
29
- const closeDialogWhenDisconnectedFlag = getFlag('GAUD-10113-close-dialog-when-disconnected', true);
30
-
31
28
  export const DialogMixin = superclass => class extends superclass {
32
29
 
33
30
  static get properties() {
@@ -110,11 +107,6 @@ export const DialogMixin = superclass => class extends superclass {
110
107
  disconnectedCallback() {
111
108
  super.disconnectedCallback();
112
109
  window.removeEventListener('d2l-mvc-dialog-open', this._handleMvcDialogOpen);
113
-
114
- // If the dialog is disconnected before the close animation finishes
115
- if (this.opened && closeDialogWhenDisconnectedFlag) {
116
- this._handleClose();
117
- }
118
110
  }
119
111
 
120
112
  async updated(changedProperties) {
@@ -356,7 +356,8 @@ class TagList extends LocalizeCoreElement(InteractiveMixin(ArrowKeysMixin(LitEle
356
356
  }
357
357
 
358
358
  async _handleResize() {
359
- const refocus = getComposedActiveElement();
359
+ let refocus = getComposedActiveElement();
360
+ if (!isComposedAncestor(this, refocus)) refocus = null;
360
361
  this._contentReady = false;
361
362
  this._chompIndex = 10000;
362
363
  await this.updateComplete;
@@ -373,12 +374,13 @@ class TagList extends LocalizeCoreElement(InteractiveMixin(ArrowKeysMixin(LitEle
373
374
  }
374
375
  this._contentReady = true;
375
376
  await this.updateComplete;
376
- refocus.focus?.();
377
+ refocus?.focus?.();
377
378
  }
378
379
 
379
380
  async _handleSlotChange() {
380
381
  if (!this._hasResized) return;
381
- const refocus = getComposedActiveElement();
382
+ let refocus = getComposedActiveElement();
383
+ if (!isComposedAncestor(this, refocus)) refocus = null;
382
384
  this._contentReady = false;
383
385
  await this.updateComplete;
384
386
 
@@ -405,7 +407,7 @@ class TagList extends LocalizeCoreElement(InteractiveMixin(ArrowKeysMixin(LitEle
405
407
  this._refocus = this.shadowRoot.querySelector('.d2l-tag-list-button');
406
408
  }
407
409
  await this._refocus?.updateComplete;
408
- (this._refocus || refocus).focus?.();
410
+ (this._refocus || refocus)?.focus?.();
409
411
  this._refocus = null;
410
412
  }
411
413
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.257.0",
3
+ "version": "3.257.2",
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",