question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bring back support for aria-haspopup

See original GitHub issue

See also #1736 as this is related to the Mentions plugin and the ARIA combobox widget.

I’ve read https://github.com/facebook/draft-js/commit/744e9b4eb4810797a93c66591fea6f9cac533b4b

Summary: aria-haspopup is used to indicate “popup button”; buttons that, when pressed, show a little menu of options. It’s not meant to indicate any element that has a dialog associated with it.

I must kindly disagree and kindly ask you to reconsider that change 🙂

Seems to me this change is not correct and a quick reading of the specifications can help understand. Please notice there are differences between ARIA 1.0 and ARIA 1.1. Thankfully, the ARIA Authoring Practices describe very well the implementation details. Probably the ARIA 1.0 should had described better what is a “menu” with regards to aria-haspopup.

ARIA 1.1 https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup aria-haspopup has several values: true, false, menu, listbox, grid, etc.

ARIA 1.0 https://www.w3.org/TR/wai-aria-1.0/states_and_properties#aria-haspopup aria-haspopup are true and false. Also, in regards to #1736 :

Indicates the object has a popup, either as a descendant or pointed to by aria-owns.

The ARIA Authoring Practices help to clarify, see the combobox widget under “WAI-ARIA Roles, States, and Properties”: https://www.w3.org/TR/wai-aria-practices-1.1/#wai-aria-roles-states-and-properties-5

ARIA 1.1 If the combobox popup has a role other than listbox, the element with role combobox has aria-haspopup set to a value that corresponds to the popup type. That is, aria-haspopup is set to grid, tree, or dialog. Note that elements with role combobox have an implicit aria-haspopup value of listbox.

ARIA 1.0 the element with role combobox has a value for aria-haspopup of listbox. Note that elements with role combobox have an implicit aria-haspopup value of listbox.

Please also notice the 1.1 pattern is different from the one implemented in the Mentions plugin because it requires a container with role=combobox, with a textbox and listbox as children. So the pattern to take into consideration for the current implementation is the 1.0 one.

Please see also the examples linked there: https://www.w3.org/TR/wai-aria-practices-1.1/#examples-1 they all use aria-haspopup.

Also, worth noting aria-haspopup is a property, not a state. That means its value shouldn’t change dynamically. It should stay unchanged. Please notice in the 3 examples of the 1.0 pattern, this attribute is aways aria-haspopup="true" regardless if the “dropdown” is closed or open.

The reason for this is that aria-haspopup is a property that informs about a feature of the combobox. For example, screen reader users need to be informed they’re in a widget that conditionally renders a “popup”, whatever the popup actually is. They need this information before activating the widget.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aferciacommented, Sep 30, 2018

@jessebeach sure then I guess it should be one of ['false', 'true', 'menu', 'listbox', 'tree', 'grid', 'dialog'] 🙂 I’d be more than happy if someone else wants to make a PR, given my time is very, very limited.

0reactions
jessebeachcommented, Sep 10, 2018

I guess the safer option would be not limiting the value and allow all of them?

@afercia I always hesitate to open the flood gates and allow anything. When we’re restrictive from the start, we reduce the risk of needing to claw back support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aria-haspopup - Accessibility - MDN Web Docs - Mozilla
The aria-haspopup attribute indicates the availability and type of interactive popup element that can be triggered by the element on which ...
Read more >
Test: aria-haspopup attribute (VoiceOver (iOS)/Safari)
Test: aria-haspopup attribute (VoiceOver (iOS)/Safari) · Go back to the test · Run this test and submit your results ...
Read more >
Accessibility: what can aria-haspopup be used for?
I have it on good authority that aria-haspopup is appropriate for sub-menus (such as a popup context menu or sub-level menu).
Read more >
6. Supported States and Properties - W3C
undefined (default): Indicates that the element does not support being dragged. aria-haspopup (property). #.
Read more >
The current state of modal dialog accessibility - TPGi
OK, now that that's squared away, let's get back to the new hotness… ... most screen readers do not yet support aria-haspopup="dialog" ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found