@brightspace-ui/core 3.148.3 → 3.148.4

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,6 +1,7 @@
1
1
  import { css, html, LitElement } from 'lit';
2
2
  import { findComposedAncestor, isComposedAncestor } from '../../helpers/dom.js';
3
3
  import { getComposedActiveElement, getFirstFocusableDescendant, getFocusableDescendants, getLastFocusableDescendant, getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
4
+ import { getFlag } from '../../helpers/flags.js';
4
5
  import { isInteractiveDescendant } from '../../mixins/interactive/interactive-mixin.js';
5
6
  import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
6
7
 
@@ -17,6 +18,8 @@ const keyCodes = {
17
18
  UP: 38
18
19
  };
19
20
 
21
+ const listItemUpButtonFixFlag = getFlag('GAUD-8229-list-up-button-fix', true);
22
+
20
23
  /**
21
24
  * A component for generating a list item's layout with forced focus ordering and grid support.
22
25
  * Focusable items placed in the "content" slot will have their focus removed; use the content-action
@@ -422,13 +425,27 @@ class ListItemGenericLayout extends RtlMixin(LitElement) {
422
425
  do {
423
426
  // this check needs to account for standard list-items as well as custom
424
427
  nestedList = previousElement.querySelector('[slot="nested"]') || previousElement.shadowRoot.querySelector('d2l-list');
425
- if (nestedList) {
426
- const nestedListItems = [...nestedList.children].filter(node => node.role === 'row');
427
- if (nestedListItems.length) {
428
- previousElement = nestedListItems[nestedListItems.length - 1];
428
+ if (listItemUpButtonFixFlag) {
429
+ // if there is nested list and nested list content is accessible
430
+ if (nestedList && (!previousElement.expandable || (previousElement.expandable && previousElement.expanded))) {
431
+ const nestedListItems = [...nestedList.children].filter(node => node.role === 'row');
432
+ if (nestedListItems.length) {
433
+ previousElement = nestedListItems[nestedListItems.length - 1];
434
+ } else {
435
+ break;
436
+ }
429
437
  } else {
430
438
  break;
431
439
  }
440
+ } else {
441
+ if (nestedList) {
442
+ const nestedListItems = [...nestedList.children].filter(node => node.role === 'row');
443
+ if (nestedListItems.length) {
444
+ previousElement = nestedListItems[nestedListItems.length - 1];
445
+ } else {
446
+ break;
447
+ }
448
+ }
432
449
  }
433
450
  } while (nestedList);
434
451
  return previousElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.148.3",
3
+ "version": "3.148.4",
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",