@brightspace-ui/core 2.95.1 → 2.97.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.
@@ -1,5 +1,5 @@
1
1
  import { css, html, LitElement } from 'lit';
2
- import { forceFocusVisible, getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
2
+ import { getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
3
3
  import { FocusMixin } from '../../mixins/focus-mixin.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
5
  import { isComposedAncestor } from '../../helpers/dom.js';
@@ -71,7 +71,7 @@ class FocusTrap extends FocusMixin(LitElement) {
71
71
  _focusFirst() {
72
72
  const focusable = this.shadowRoot &&
73
73
  getNextFocusable(this.shadowRoot.querySelector('.d2l-focus-trap-start'));
74
- if (focusable) forceFocusVisible(focusable);
74
+ if (focusable) focusable.focus();
75
75
  this.dispatchEvent(new CustomEvent('d2l-focus-trap-enter', { bubbles: true, composed: true }));
76
76
  }
77
77
 
@@ -94,9 +94,7 @@ class FocusTrap extends FocusMixin(LitElement) {
94
94
  const firstFocusable = getNextFocusable(this.shadowRoot.querySelector('.d2l-focus-trap-start'));
95
95
  if (firstFocusable) {
96
96
  // Delay to re-apply the focus effects as a visual clue when there is only one focusable element
97
- setTimeout(() => {
98
- forceFocusVisible(firstFocusable);
99
- }, 50);
97
+ setTimeout(() => firstFocusable.focus(), 50);
100
98
  return;
101
99
  }
102
100
  }
@@ -120,9 +118,7 @@ class FocusTrap extends FocusMixin(LitElement) {
120
118
  const lastFocusable = getPreviousFocusable(this.shadowRoot.querySelector('.d2l-focus-trap-end'));
121
119
  if (lastFocusable) {
122
120
  // Delay to re-apply the focus effects as a visual clue when there is only one focusable element
123
- setTimeout(() => {
124
- forceFocusVisible(lastFocusable);
125
- }, 50);
121
+ setTimeout(() => lastFocusable.focus(), 50);
126
122
  return;
127
123
  }
128
124
  }
@@ -1,6 +1,5 @@
1
1
  import '../scroll-wrapper.js';
2
2
  import { css, html, LitElement } from 'lit';
3
- import { forceFocusVisible } from '../../../helpers/focus.js';
4
3
  import { RtlMixin } from '../../../mixins/rtl-mixin.js';
5
4
  import { styleMap } from 'lit/directives/style-map.js';
6
5
 
@@ -53,7 +52,7 @@ class TestScrollWrapper extends RtlMixin(LitElement) {
53
52
  }
54
53
 
55
54
  focus() {
56
- if (this.shadowRoot) forceFocusVisible(this.shadowRoot.querySelector('d2l-scroll-wrapper')._container);
55
+ if (this.shadowRoot) this.shadowRoot.querySelector('d2l-scroll-wrapper')._container.focus();
57
56
  }
58
57
 
59
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.95.1",
3
+ "version": "2.97.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",