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

<pf-dropdown-item>: menutitem role must be contained by parent with menu role #2705

Closed
nikkimk opened this issue Mar 11, 2024 · 4 comments
Closed
Assignees
Labels

Comments

@nikkimk
Copy link
Collaborator

nikkimk commented Mar 11, 2024

Description of the issue

When testing dropdown, axeDevTools has the following error:

Ensures elements with an ARIA role that require parent roles are contained by them

.overview > .example-preview > pf-dropdown > pf-dropdown-item:nth-child(1),#item
<div id="item" role="menuitem" tabindex="0">
          <slot name="icon"></slot>
          <slot></slot>
        </div>
To solve this problem, you need to fix the following:
Required ARIA parents role not present: menu, menubar, group

Impacted component(s)

  • pf-dropdown

Steps to reproduce

  1. Go to Patternfly Elements -> Dropdown
  2. Run axeDevTools
  3. See error message
  4. UPDATED: View pf-dropdown-menu's accessibility tree in the Element Inspector.
  5. UPDATED: role: menu is not being applied.

Expected behavior

The element marked as role="menuitem" needs to be a child of the element with role="menu". UPDATE: pf-dropdown-menu should have a menu role.

Related issues

@bennypowers
Copy link
Member

This may arise when items are slotted into the default slot - in which case they'll be projected into a menu role parent in the shadow root. May we in that case allow ourselves to treat this as a false positive?

@nikkimk
Copy link
Collaborator Author

nikkimk commented Mar 12, 2024

This may arise when items are slotted into the default slot - in which case they'll be projected into a menu role parent in the shadow root. May we in that case allow ourselves to treat this as a false positive?

After more investigation it looks like pf-dropdown-menu's role is not showing up as menu in the accessibility tree, which is an issue.

@bennypowers
Copy link
Member

Are we failing to load the element internals polyfill?

@bennypowers
Copy link
Member

This should be good now, following tests by @nikkimk and @hellogreg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants