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

[aria-required-parent] invalid false positive #2513

Closed
ljosberinn opened this issue Sep 9, 2020 · 6 comments
Closed

[aria-required-parent] invalid false positive #2513

ljosberinn opened this issue Sep 9, 2020 · 6 comments
Assignees
Labels
fix Bug fixes good first issue For first-time contributors rules Issue or false result from an axe-core rule
Milestone

Comments

@ljosberinn
Copy link
Contributor

ljosberinn commented Sep 9, 2020

Expectation: HTML here passes just fine

Actual: does not pass .toHaveNoVioliations through jest-axe:

image

Motivation:

HTML spec says:

Authors MUST ensure that menu item radios are owned by an element with role group, menu, or menubar in order to identify that they are related widgets. Authors MAY separate menu items into sets by use of a separator or an element with an equivalent role from the native markup language.
If a menu or menubar contains more than one group of menuitemradio elements, or if the menu contains one group and other, unrelated menu items, authors SHOULD nest each set of related menuitemradio elements in an element using the group role, and authors SHOULD delimit the group from other menu items with an element using the separator role.

given html matches the 2nd case:

  • menu contains more than one group of menuitemradio elements
  • (...) other, unrelated menu items, authors SHOULD nest each set of related menuitemradio elements in an element using the group role
  • (...) and authors SHOULD delimit the group from other menu items with an element using the separator role
  • div role menu
    • div role group
      • button role menuitemradio
      • button role menuitemradio
      • hr, implicit role separator (making it explicit doesnt change anything fwiw)
      • a role menuitem
  • minimum reproduction
  • validates fine here as valid html, not sure if that checks for aria beyond redundancy though
  • it worked fine before v4.0, so I presume something in this commit here broke
  • removing div role group fixes it. adding a second group around the solo menuitem anchor on bottom also highlights this one as broken

axe-core version: 4.0.2
~~axe-webdriver, extension or other integration version: X.Y.Z~~

Browser and Assistive Technology versions

For Tooling issues:
- Node version: 14.7.0XX  
- Platform:  Win10
@straker
Copy link
Contributor

straker commented Sep 9, 2020

Yep, seems our standard object is missing group from required context of menuitemradio

@straker straker added fix Bug fixes rules Issue or false result from an axe-core rule labels Sep 9, 2020
@straker straker added this to the axe-core 4.1 milestone Sep 9, 2020
@straker straker added the good first issue For first-time contributors label Sep 11, 2020
@straker
Copy link
Contributor

straker commented Sep 15, 2020

@ljosberinn would you be interested in putting together a pr for this?

@ljosberinn
Copy link
Contributor Author

Can do, got a full plate at the moment, sorry - is there more to this than literally just adding it to that array?

@straker
Copy link
Contributor

straker commented Sep 15, 2020

That's it. Adding 'group' to the array is the entire pr.

@padmavemulapati
Copy link

with the change (along with menu, and menubar , group also added to role solved the false positive)
image

@straker
Copy link
Contributor

straker commented Sep 24, 2020

No docs required

@straker straker closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes good first issue For first-time contributors rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

3 participants