-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SubMenu Accessibility #76
Conversation
src/utils/menu/aria-submenu.js
Outdated
// Grab focusable menu items that are not hidden | ||
let test = this.domNode.querySelectorAll('[class^="el-menu--"]:not([style*="display: none"]) > .el-menu > li'); | ||
// If current idx is not focusable, skip it | ||
while (!Array.from(test).includes(this.subMenuItems[idx]) && ((isDown && idx < this.subMenuItems.length) || (!isDown && idx >= 0))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need to be ES5 compatible? not sure if Array.from
would have been polyfilled here yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine since workflow will not be supported in IE, but made it ES5 compatible just in case.
Updated tabbing for Menu and SubMenu components so only shown items can be tabbed to. And submenus open with 'enter' now too.