@brightspace-ui/core 3.342.2 → 3.343.0

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.
@@ -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.0",
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",