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

CommandBar does not have relevant role for its child element #14993

Closed
Harkesh030679 opened this issue Sep 11, 2020 · 12 comments
Closed

CommandBar does not have relevant role for its child element #14993

Harkesh030679 opened this issue Sep 11, 2020 · 12 comments
Assignees
Labels
Area: Accessibility Component: CommandBar Fluent UI react (v8) Issues about @fluentui/react (v8) Needs: Investigation The Shield Dev should investigate this issue and propose a fix

Comments

@Harkesh030679
Copy link

Harkesh030679 commented Sep 11, 2020

CommandBar does not have relevant role for its child element in accessibility Insight tool

Environment Information

OS: Win 10
Browser: Edge/Chrome
Tool- Accessibility insight tool

Describe the issue:

Step 1- Open web site in chrome browser--https://developer.microsoft.com/en-us/fluentui#/controls/web/commandbar
Step 2- Run Accessibility Insight tool as per below snap and see the issue
Command bar

Please provide a reproduction of the issue in a codepen:

Step 1- Open web site in chrome browser--https://developer.microsoft.com/en-us/fluentui#/controls/web/commandbar
Step 2- Run Accessibility Insight tool as per below snap and see the issue

Command bar

Step 3-You can see child element has Role=Group, that should not be relevant role for menubar as suggested by Accessibility insight tool.

Actual behavior:

Child elements do not have relevant role in command bar

Expected behavior:

Child elements should have role=menuitem or any relevant in command bar

Documentation describing expected behavior

@paulgildea
Copy link
Member

@Harkesh030679 Thanks for the thorough investigation! That's really appreciated!

@smhigley FYI

@joschect / @JustSlone Would this be considered a breaking change?

@paulgildea paulgildea added Area: Accessibility Component: CommandBar Fluent UI react (v8) Issues about @fluentui/react (v8) Needs: Investigation The Shield Dev should investigate this issue and propose a fix and removed Needs: Triage 🔍 labels Sep 11, 2020
@JustSlone
Copy link
Collaborator

We generally consider DOM changes breaking. However, given this is causing issues in Accessibility Insights, and it's a pretty minor DOM change. I think we could take it. I am interested in @joschect 's opinion on the risk though.

However, one important note on this change. I'm a bit perplexed as to why the current structure is invalid.
This case, where we have a menubar, then multiple groups of menuitems, seems like exactly the intended use case for role="group". the MDN documentation even has a very similar example see Example 2 here

@smhigley or @jurokapsiar Do you have more context on this particular rule and what the right structure is here? It seems like the group role should be a valid change here grouping the menuitems.

This looks related to this change in axe-core (dequelabs/axe-core#2131) fixes this issue (dequelabs/axe-core#2076).

@miroslavstastny
Copy link
Member

FYI - @kolaps33

@brandonthomas
Copy link
Contributor

I'm wondering if the reason Accessibility Insights failed is because the group isn't around menuitemradio? The spec has the following in it:
image

Not 100% sure but this seems to imply the group role should only be around radio buttons within menu or menubar.

@brandonthomas
Copy link
Contributor

This is also somewhat related to #11832 since the way the AT reads this out is counter to how it behaves. Would be nice to have these fixed all at once.

@JustSlone
Copy link
Collaborator

Right, @brandonthomas so this spec (link to menubar spec) suggests that in the menubar case the group role's purpose is specifically to group menuitemradios, and even tho it's seems logical to group menuitems in this way (and in our cause actually improves the semantics of the html) it's not allowed per the ARIA menubar spec.

@smhigley or @kolaps33 You all have more experience interpreting the ARIA spec, any thoughts here?

@JustSlone
Copy link
Collaborator

Also here's a good example ARIA menubar example. Plus another reference: https://act-rules.github.io/rules/bc4a75 (tho this doesn't discuss the presence of group).

Per the example, and the ARIA spec, it looks like we should either remove role="group" or change it to role="none". I also followed up in the PR I linked above to see if disallowing this html structure was intentional.

@smhigley
Copy link
Contributor

smhigley commented Sep 19, 2020

This is fixed in the ARIA 1.2 spec, where group is a valid descendant of menubar when it contains any of the menuitem, menuitemcheckbox, or menuitemradio roles: https://w3c.github.io/aria/#menubar.

I'd say this is an axe issue, not a fluent one. Though, regardless of what the spec says, it could be worth investigating how group behaves within menus and menubars, then deciding whether to use it, and whether to log screen reader issues.

@brandonthomas
Copy link
Contributor

@smhigley since that is in editor's draft, how should we take that? Can we bank that this will be updated and we're safe to resolve bugs against this issue? I don't want to assume we're compliant and turn out to not be.

@jgage176
Copy link
Contributor

jgage176 commented Oct 8, 2020

Right now it is still failing Accessibility Insights and showing up as an a11y failure, so I would vote for keeping it open until Accessibility Insights reflects any new standards, as until then will be be showing up on a11y test passes.

@JustSlone
Copy link
Collaborator

@joschect It seems like the temp fix would be to pass in role={'none'} on OverflowSet here (perhaps on both overflowsets actually) - CommandBar.base.tsx#L128

Does that seem right?

@JustSlone
Copy link
Collaborator

This was fixed in #15511 should be available in v7.147.0

@microsoft microsoft locked as resolved and limited conversation to collaborators Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Accessibility Component: CommandBar Fluent UI react (v8) Issues about @fluentui/react (v8) Needs: Investigation The Shield Dev should investigate this issue and propose a fix
Projects
None yet
Development

No branches or pull requests

9 participants