Skip to content
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

Merged
merged 10 commits into from
May 9, 2022
Merged

Fix SubMenu Accessibility #76

merged 10 commits into from
May 9, 2022

Conversation

lcarrnix
Copy link

@lcarrnix lcarrnix commented May 5, 2022

Updated tabbing for Menu and SubMenu components so only shown items can be tabbed to. And submenus open with 'enter' now too.

@lcarrnix lcarrnix marked this pull request as ready for review May 5, 2022 16:39
// 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))) {

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

Copy link
Author

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.

@lcarrnix lcarrnix removed the request for review from fishercognitoforms May 9, 2022 14:31
@tskimmett tskimmett merged commit 11fbe32 into cognito May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants