Skip to content

Commit 01f02e2

Browse files
chore: add more test-suites
1 parent 2cda142 commit 01f02e2

16 files changed

Lines changed: 591 additions & 384 deletions

packages/ui/components/menu/src/InteractiveListMixin.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* eslint-disable max-classes-per-file */
22
/* eslint-disable import/no-extraneous-dependencies */
33
import { html, css, LitElement } from 'lit';
4-
import { SlotMixin, DisabledMixin } from '@lion/ui/core.js';
4+
import { SlotMixin, DisabledMixin, uuid } from '@lion/ui/core.js';
55
import { dedupeMixin } from '@open-wc/dedupe-mixin';
66
import { MoreButtonMenuMixin } from './MoreButtonMenuMixin.js';
7-
import { uuid } from './utils/uuid.js';
87
import { isInView } from './utils/isInView.js';
98
import {
109
isDisabled,
@@ -167,7 +166,7 @@ const InteractiveListMixinImplementation = superclass =>
167166
multipleChoice: { type: Boolean, attribute: 'multiple-choice' },
168167
// TODO: align with name of open-ui
169168
selectionFollowsFocus: { type: Boolean, attribute: 'selection-follows-focus' },
170-
// TODO: align with name of open-ui => "wrap" in focsugroup
169+
// TODO: align with name of open-ui => "wrap" in focusgroup
171170
rotateKeyboardNavigation: { type: Boolean, attribute: 'rotate-keyboard-navigation' },
172171
// TODO: align with name of open-ui
173172
noPreselect: { type: Boolean, attribute: 'no-preselect' },
@@ -556,7 +555,7 @@ const InteractiveListMixinImplementation = superclass =>
556555
// having hideVisually as hide mechanism (opening on focus, closing on blur).
557556
// N.B. this._listNode has `display:flex`. This means we need to add `text-wrap: nowrap;`
558557
// to avoid elems going over two lines, or give them a max-height based on measuring the height of one item.
559-
// 2. N.B. hideVisually needs to be implementd in OverlayController.
558+
// 2. N.B. hideVisually needs to be implemented in OverlayController.
560559
// 3. when the more menu opens a next level, MultiLevelListMixin will be applied to the host as well.
561560
// That means it knows when a child menu is open. If _subListMap of one of the items is open, we should hide more menu like this:
562561
// https://jsfiddle.net/a4ocktfp/19/

packages/ui/components/menu/src/LionMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class LionMenu extends MultiLevelListMixin(LitElement) {
187187
}
188188

189189
if (!multiple) {
190-
// Uncheck all
190+
// Uncheck all within group
191191
listItemsWithinGroup.forEach(listItem => {
192192
setChecked(listItem, true);
193193
});

packages/ui/components/menu/src/LionTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class LionTree extends MultiLevelListMixin(LitElement) {
2222
super.updated(changedProperties);
2323

2424
if (changedProperties.has('level')) {
25-
if (this.level > 0) {
25+
if (this.level > 1) {
2626
this._listNode.setAttribute('role', 'group');
2727
}
2828
this.__setAriaLevelForListItems();

packages/ui/components/menu/src/MultiLevelListMixin.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ const MultiLevelListMixinImplementation = superclass =>
3737
* @configure DisclosureMixin
3838
*/
3939
get _invokerNode() {
40-
// @ts-ignore - accessing static method and super property
41-
return this.constructor._getFocusableInvokerEl(this.invokerNode) || super._invokerNode;
40+
if (this.constructor._getFocusableInvokerEl && this.invokerNode) {
41+
// @ts-ignore - accessing static method and super property
42+
return this.constructor._getFocusableInvokerEl(this.invokerNode);
43+
}
44+
return super._invokerNode;
4245
}
4346

4447
/**
@@ -84,6 +87,7 @@ const MultiLevelListMixinImplementation = superclass =>
8487
this.noPreselect = true;
8588
/**
8689
* @configure InteractiveListMixin
90+
* @type {'activedescendant'|'roving-tabindex'|'tabbable-disclosure'}
8791
*/
8892
this._activeMode = 'roving-tabindex';
8993
/**
@@ -257,7 +261,7 @@ const MultiLevelListMixinImplementation = superclass =>
257261
this._subListMap.forEach(subList => {
258262
subList.listItems.forEach(
259263
/** @param {LionItem|HTMLElement} item */ item => {
260-
if (isChecked(item)) {
264+
if (isChecked(item) && subList._invokerNode) {
261265
setChecked(subList._invokerNode);
262266
}
263267
},

packages/ui/components/menu/src/utils/uuid.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)