-
Notifications
You must be signed in to change notification settings - Fork 344
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
Discuss removing recommendation in menubutton pattern to add/remove aria-expanded="true #697
Comments
removing it from where? this lacks a bit of context... |
@patrickhlauke, was filling in issue and hit enter... its there now. |
@DavidMacDonald, not including aria-expanded when the menu is not displayed is optional behavior. The way we worded this in the pattern is:
If we updated the states and properties table on the menubutton example pages to include similar language, would that be sufficient? I don't see a need to change the ARIA spec. |
It just seems buggy to be recommending to add and remove the entire attribute instead of toggling it true/false. What about lobbying the AT to ignore aria-expanded="false" when aria-haspopup is present. |
If add/remove is preferred, a proper boolean attribute is The Right Thing. But AFAIK wai-aria has no true boolean attributes. The add/remove mechanism of true boolean attributes are already a source of many cognitive errors (because IMO an attribute with possible values true/false should have those values set explicitly, rather than removing it to suggest 'false'. Inconsistencies are inevitable if an attribute becomes optional in a some states and not others. Reducing doubt amongst those consulting the examples should override vague concerns about 'chattiness'. The 'chattiness' problem is for the AT vendors to handle (if indeed it is a problem at all). But... consistency first. Whichever is the preferred mechanism, let's do it the same way in all examples and recommendations - and if we're going with add/remove, perhaps provide a note about why this might be counter-intuitive. Otherwise it will become a FAQ. |
The ARIA Authoring Practices (APG) Task Force just discussed The full IRC log of that discussion<jugglinmike> Topic: Issue 697 about aria-expanded=false on menu buttons<jugglinmike> github: https://github.com//issues/697 <jugglinmike> s/a patch/a patch for issue gh-1611/ <jugglinmike> Matt_King: People were so confused by this that they were suggesting a new property in gh-697 <jugglinmike> Matt_King: I have written a pull request which removes the recommendation <jugglinmike> Matt_King: If we go that route, we will need to change three menu button examples <jugglinmike> Bryan_Garaventa: we originally proposed this because on some devices (E.g. those based on touch), you cannot perceive menu hierarchy <jugglinmike> Bryan_Garaventa: That leads me to two questions <jugglinmike> Bryan_Garaventa: How do you identify hierarchy if you take it out? <jugglinmike> Matt_King: Today, our menu buttons don't have "aria-expanded=false" when they are collapsed <jugglinmike> Bryan_Garaventa: Oh, so this isn't about removing the attribute <jugglinmike> Matt_King: No, so it's about applying it consistently <siri> +1 <jugglinmike> Bryan_Garaventa: Ah! Yes, I would recommend consistency. Especially for those using touch screen devices <jugglinmike> Matt_King: The clarity of knowing that it is collapsed is helpful <dmontalvo> +1 to adding aria-expanded="false" when collapsed for clarity. <jugglinmike> siri: I support this, as well <jugglinmike> Matt_King: Sounds like we have a lot of votes here, all in favor! <jugglinmike> Matt_King: There are three menu button examples that would need to change <jugglinmike> Matt_King: I have already submitted a pull request for the pattern <jugglinmike> Matt_King: I think this should be two separate pull requests. I think the code changes should be done in a separate pull request <jugglinmike> Zakim, end the meeting |
…enus are closed (pull #2839) Closes issues #697 and #2834 with the following changes: * Revise menu button pattern to specify that aria-expanded is set to false when the menu is not displayed. * Revise JS and documentation for 3 menu button examples and the toolbar example to set aria-expanded false when their menus are closed. * Adjusts corresponding regression tests to ensure the state of expanded is true when the menus are open and false when the menus are closed. --------- Co-authored-by: Matt King <a11yThinker@gmail.com>
For menu buttons and menu bars there is a different treatment of aria-expanded.
For the menu button, there is no aria-expanded on page load and then only added when it's open. So it doesn't toggle between true and false ... instead the entire attribute is added and removed. This apparently is to reduce chattiness
This process of adding and removing the entire attribute on expand/collapse has spotty support in JAWS, VO and NVDA. It is also tough to explain to devs... They will ask why add and remove the entire attribute when there is true/false to toggle in aria-expanded.
On the other hand, the navigation menu has aria-expanded=false on page load. So the two examples are inconsistent.
It seems like we could have a more elegant and consistent solution for aria-expanded on menus.
Maybe I should file a but against aria-haspop over on the aria 1.1 to allow an extra attribute to swap out for menus so it doesn't have the redundancy but doesn't require the clunky adding and removing the full attribute to show expanded state....
Or maybe AT should not announce collapsed when an aria-popup is present??
Anyway, adding removing the entire attribute and value on show/hide smells like a hack to address AT issues, or to overcome a limitation of wai-aria.
This is the current pertinent language in the button example:
The text was updated successfully, but these errors were encountered: