@brightspace-ui/core 3.342.2 → 3.343.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.
@@ -394,18 +394,15 @@ export const DialogMixin = superclass => class extends superclass {
394
394
  ));
395
395
  }
396
396
 
397
- _handleDialogCloseWithinNative(e) {
397
+ _handleDialogCloseWithin(e) {
398
+ if (!this._useNative) this._nestedShowing = false;
398
399
  // prevent close event from bubbling and closing parent dialogs
399
400
  e.stopPropagation();
400
401
  }
401
402
 
402
- _handleDialogCloseWithinNonNative(e) {
403
- this._nestedShowing = false;
404
- e.stopPropagation();
405
- }
406
-
407
- _handleDialogOpenWithinNonNative(e) {
408
- this._nestedShowing = true;
403
+ _handleDialogOpenWithin(e) {
404
+ if (!this._useNative) this._nestedShowing = true;
405
+ // prevent open event from bubbling and running load logic in ancestors
409
406
  e.stopPropagation();
410
407
  }
411
408
 
@@ -566,7 +563,8 @@ export const DialogMixin = superclass => class extends superclass {
566
563
  class="${classMap(dialogOuterClasses)}"
567
564
  @click="${this._handleClick}"
568
565
  @close="${this._handleClose}"
569
- @d2l-dialog-close="${this._handleDialogCloseWithinNative}"
566
+ @d2l-dialog-close="${this._handleDialogCloseWithin}"
567
+ @d2l-dialog-open="${this._handleDialogOpenWithin}"
570
568
  @d2l-fullscreen-within="${this._handleFullscreenWithin}"
571
569
  id="${this._dialogId}"
572
570
  @keydown="${this._handleKeyDown}"
@@ -579,8 +577,8 @@ export const DialogMixin = superclass => class extends superclass {
579
577
  aria-labelledby="${info.labelId}"
580
578
  class="${classMap(dialogOuterClasses)}"
581
579
  @click="${this._handleClick}"
582
- @d2l-dialog-close="${this._handleDialogCloseWithinNonNative}"
583
- @d2l-dialog-open="${this._handleDialogOpenWithinNonNative}"
580
+ @d2l-dialog-close="${this._handleDialogCloseWithin}"
581
+ @d2l-dialog-open="${this._handleDialogOpenWithin}"
584
582
  @d2l-fullscreen-within="${this._handleFullscreenWithin}"
585
583
  id="${this._dialogId}"
586
584
  role="${info.role}"
@@ -24,6 +24,7 @@ import '../tooltip/tooltip.js';
24
24
 
25
25
  import { bodyCompactStyles, bodySmallStyles, bodyStandardStyles, heading4Styles } from '../typography/styles.js';
26
26
  import { css, html, LitElement, nothing } from 'lit';
27
+ import { getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
27
28
  import { getOverflowDeclarations, overflowEllipsisDeclarations } from '../../helpers/overflow.js';
28
29
  import { announce } from '../../helpers/announce.js';
29
30
  import { classMap } from 'lit/directives/class-map.js';
@@ -471,6 +472,7 @@ class Filter extends FocusMixin(LocalizeCoreElement(LitElement)) {
471
472
 
472
473
  const clear = html`
473
474
  <d2l-button-subtle
475
+ class="button-clear"
474
476
  @click="${this._handleClear}"
475
477
  ?disabled="${dimension.loading || dimension.appliedCount === 0}"
476
478
  description="${this.localize('components.filter.clearDescription', { filterName: dimension.text })}"
@@ -765,18 +767,21 @@ class Filter extends FocusMixin(LocalizeCoreElement(LitElement)) {
765
767
 
766
768
  _handleClear() {
767
769
  const dimension = this._getActiveDimension();
770
+ announce(this.localize('components.filter.clearAnnounce', { filterName: dimension.text }));
768
771
 
769
772
  if (dimension.searchType !== 'none') {
770
773
  this._handleClearSearch(dimension);
771
774
  const searchInput = this.shadowRoot.querySelector('d2l-input-search');
772
775
  if (searchInput) searchInput.value = '';
773
776
  }
774
-
777
+ const buttonClear = this.shadowRoot.querySelector('.button-clear');
778
+ if (this.shadowRoot.activeElement === buttonClear) {
779
+ const focusable = getNextFocusable(buttonClear, false, true, true) ?? getPreviousFocusable(buttonClear, false, true, true);
780
+ focusable?.focus();
781
+ }
775
782
  this._performDimensionClear(dimension);
776
783
  this._dispatchChangeEventNow(false);
777
784
  this.requestUpdate();
778
-
779
- announce(this.localize('components.filter.clearAnnounce', { filterName: dimension.text }));
780
785
  }
781
786
 
782
787
  _handleClearAll() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.342.2",
3
+ "version": "3.343.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",