Skip to content

Commit c6832d2

Browse files
committed
make sure disabled menu items are focusable but not participating in directional navigation
1 parent ff72a5f commit c6832d2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

packages/web-components/src/menu-list/menu-list.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ export class MenuList extends FASTElement {
123123

124124
this.menuItems?.forEach((item: HTMLElement) => {
125125
item.dataset.indent = `${indent}`;
126-
if (!item.hasAttribute('disabled')) {
127-
item.tabIndex = 0;
128-
}
126+
item.tabIndex = item.hasAttribute('disabled') ? -1 : 0;
129127
});
130128
}
131129

0 commit comments

Comments
 (0)