-
Notifications
You must be signed in to change notification settings - Fork 209
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
Bug/menu item missing aria labels #3417
Conversation
Tachometer resultsChromeaction-menu permalink
menu permalink
picker permalink
split-button permalink
Firefoxaction-menu permalink
menu permalink
picker permalink
split-button permalink
|
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.
How did you test this? Did you utilise the accessibility tree or screen reader?
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.
There’s a bunch of white space addition, was the intentional?
extra white spaces have been removed now |
I have used both screen reader and accessibility tree |
packages/menu/src/MenuItem.ts
Outdated
@@ -425,6 +430,11 @@ export class MenuItem extends LikeAnchor(Focusable) { | |||
this.handleSubmenuPointerenter | |||
); | |||
submenu.addEventListener('change', this.handleSubmenuChange); | |||
if (!submenu.id) { | |||
// if the consumer has already applied an ID to this element then we won't explicitly aplly ID |
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.
please remove the comments here!
packages/menu/src/Menu.ts
Outdated
@@ -631,6 +631,7 @@ export class Menu extends SpectrumElement { | |||
} | |||
item.focused = this.hasVisibleFocusInTree(); | |||
this.setAttribute('aria-activedescendant', item.id); | |||
|
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.
remove this white space
* fix(meter): added role meter progressbar in meter component (#3459) Co-authored-by: Rajdeep Chandra <[email protected]> * docs: updated swatch mixed documentations (#3455) Co-authored-by: Rajdeep Chandra <[email protected]> * fix(textfield): update focus state when [multiline][quiet] (#3452) * fix: menu item missing aria labels (#3417) * testing * fix(menu): menu-item with submenu lacks aria-haspopup and aria-expanded * fix(menu): added aria-expanded and aria-haspopup to menu-item * fix(menu): fixed the aria-controls attribute of menu-item * fix(menu): reviewed changes * fix(menu): reviewed changes-2 * fix(menu): removed the comment * fix(menu): removed white space * fix(menu): white space removed * chore: bump @web/test-runner from 0.16.1 to 0.17.0 Bumps [@web/test-runner](https://github.com/modernweb-dev/web/tree/HEAD/packages/test-runner) from 0.16.1 to 0.17.0. - [Release notes](https://github.com/modernweb-dev/web/releases) - [Changelog](https://github.com/modernweb-dev/web/blob/master/packages/test-runner/CHANGELOG.md) - [Commits](https://github.com/modernweb-dev/web/commits/@web/[email protected]/packages/test-runner) --- updated-dependencies: - dependency-name: "@web/test-runner" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: bump webpack-bundle-analyzer from 4.8.0 to 4.9.0 Bumps [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) from 4.8.0 to 4.9.0. - [Release notes](https://github.com/webpack-contrib/webpack-bundle-analyzer/releases) - [Changelog](https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CHANGELOG.md) - [Commits](webpack-contrib/webpack-bundle-analyzer@v4.8.0...v4.9.0) --- updated-dependencies: - dependency-name: webpack-bundle-analyzer dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: bump netlify-cli from 12.12.0 to 15.9.0 Bumps [netlify-cli](https://github.com/netlify/cli) from 12.12.0 to 15.9.0. - [Release notes](https://github.com/netlify/cli/releases) - [Changelog](https://github.com/netlify/cli/blob/main/CHANGELOG.md) - [Commits](netlify/cli@v12.12.0...v15.9.0) --- updated-dependencies: - dependency-name: netlify-cli dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: bump husky from 8.0.2 to 8.0.3 Bumps [husky](https://github.com/typicode/husky) from 8.0.2 to 8.0.3. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](typicode/husky@v8.0.2...v8.0.3) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * chore: bump word-wrap from 1.2.3 to 1.2.4 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * chore: bump @types/react from 18.0.25 to 18.2.15 Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.25 to 18.2.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Rajdeep Chandra <[email protected]> Co-authored-by: Rajdeep Chandra <[email protected]> Co-authored-by: Piyush Vashisht <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description
Added aria-haspopup,aria-expanded and aria-controls to MenuItem with subitem.
Related issue(s)
#3248
Motivation and context
The following attributes { aria-expanded , aria-haspopup and aria-controls } did not exist for a MenuItem with subitem so I added them.
How has this been tested?
Uploading Screen Recording 2023-07-12 at 8.18.21 PM.mov…
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.