@brightspace-ui/core 2.80.5 → 2.80.6

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.
@@ -3,7 +3,6 @@ import { css, html, LitElement } from 'lit';
3
3
  import { cssEscape, getComposedChildren, getComposedParent, isVisible } from '../../helpers/dom.js';
4
4
  import { getUniqueId } from '../../helpers/uniqueId.js';
5
5
 
6
- export const BACKDROP_ROLE = 'data-d2l-backdrop-role';
7
6
  const BACKDROP_HIDDEN = 'data-d2l-backdrop-hidden';
8
7
  const BACKDROP_ARIA_HIDDEN = 'data-d2l-backdrop-aria-hidden';
9
8
 
@@ -68,7 +67,8 @@ class Backdrop extends LitElement {
68
67
  transition: none;
69
68
  }
70
69
  @media (prefers-reduced-motion: reduce) {
71
- :host {
70
+ :host,
71
+ :host([slow-transition]) {
72
72
  transition: none;
73
73
  }
74
74
  }
@@ -162,20 +162,13 @@ function hideAccessible(target) {
162
162
  if (path.indexOf(child) !== -1) continue;
163
163
  if (child.hasAttribute(BACKDROP_HIDDEN)) continue;
164
164
 
165
- const role = child.getAttribute('role');
166
- if (role) child.setAttribute(BACKDROP_ROLE, role);
167
- child.setAttribute('role', 'presentation');
168
-
169
- if (child.nodeName === 'FORM' || child.nodeName === 'A') {
170
- const ariaHidden = child.getAttribute('aria-hidden');
171
- if (ariaHidden) child.setAttribute(BACKDROP_ARIA_HIDDEN, ariaHidden);
172
- child.setAttribute('aria-hidden', 'true');
165
+ if (child.hasAttribute('aria-hidden')) {
166
+ child.setAttribute(BACKDROP_ARIA_HIDDEN, child.getAttribute('aria-hidden'));
173
167
  }
168
+ child.setAttribute('aria-hidden', 'true');
174
169
 
175
170
  child.setAttribute(BACKDROP_HIDDEN, BACKDROP_HIDDEN);
176
171
  hiddenElements.push(child);
177
-
178
- hideAccessibleChildren(child);
179
172
  }
180
173
  };
181
174
 
@@ -204,21 +197,11 @@ export function preventBodyScroll() {
204
197
  function showAccessible(elems) {
205
198
  for (let i = 0; i < elems.length; i++) {
206
199
  const elem = elems[i];
207
- const role = elem.getAttribute(BACKDROP_ROLE);
208
- if (role) {
209
- elem.setAttribute('role', role);
210
- elem.removeAttribute(BACKDROP_ROLE);
200
+ if (elem.hasAttribute(BACKDROP_ARIA_HIDDEN)) {
201
+ elem.setAttribute('aria-hidden', elem.getAttribute(BACKDROP_ARIA_HIDDEN));
202
+ elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
211
203
  } else {
212
- elem.removeAttribute('role');
213
- }
214
- if (elem.nodeName === 'FORM' || elem.nodeName === 'A') {
215
- const ariaHidden = elem.getAttribute(BACKDROP_ARIA_HIDDEN);
216
- if (ariaHidden) {
217
- elem.setAttribute('aria-hidden', ariaHidden);
218
- elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
219
- } else {
220
- elem.removeAttribute('aria-hidden');
221
- }
204
+ elem.removeAttribute('aria-hidden');
222
205
  }
223
206
  elem.removeAttribute(BACKDROP_HIDDEN);
224
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "2.80.5",
3
+ "version": "2.80.6",
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",