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

Consider to remove aria-haspopup #30

Closed
afercia opened this issue Aug 5, 2017 · 7 comments
Closed

Consider to remove aria-haspopup #30

afercia opened this issue Aug 5, 2017 · 7 comments

Comments

@afercia
Copy link

afercia commented Aug 5, 2017

Hello. Happy to see you're focusing in developing accessible components. Thanks for this 🙂

I'm not sure aria-haspopup is used properly though.

aria-haspopup is a property, not a state. It's meant to indicate if an element has a popup that appears on some user activation, regardless of the popup visibility. In other words, when there's a popup, it should always be true even when the popup is not displayed. Worth nothing with ARIA 1.1 (still a Candidate Recommendation), things will change a bit and there will be more values available.

Additionally, unless I'm missing something, worth considering a combobox shouldn't have an aria-haspopup property at all. Unfortunately, the related section on the ARIA Authoring Practices is under some re-work https://www.w3.org/TR/wai-aria-practices/#combobox and they point to the related GitHub issue: w3c/aria-practices#31

From there, you can refer to the sections that were temporarily removed (https://rawgit.com/w3c/aria-practices/master/aria-practices-DeletedSectionsArchive.html#combobox) and also to the section with general considerations about popups and drop-downs:

5.4 Popups and drop-downs
https://rawgit.com/w3c/aria-practices/master/aria-practices-DeletedSectionsArchive.html#relations_haspopup

where it's clearly stated:

Combo boxes, or drop down lists, work differently. Controls with the role combobox must contain a list of items that can be opened, usually as a drop-down. Because this is intrinsic to the functionality of a combo box, it does not need to be explicitly indicated with aria-haspopup.

@moroshko
Copy link
Owner

@afercia Thanks a lot for such a thorough research!

Out of interest, I checked what other popular websites do, and found that:

  • Google - implements aria-haspopup with true/false values, like we do in react-autowhatever.
  • Bing and usa.gov - implement aria-haspopup which is always true, which supports your theory that it's a property, not a state.
  • Ebay - implements aria-haspopup which is always false, which seems weird.
  • Facebook, LinkedIn and Twitter- don't implement aria-haspopup, which supports your theory that it can be removed.

I wonder why Google decided to implement it this way. Any ideas?

@afercia
Copy link
Author

afercia commented Aug 22, 2017

I wonder why Google decided to implement it this way. Any ideas?

@moroshko honestly I have no idea 🙂 My only (wild) guess is maybe some years ago the whole combobox pattern wasn't supported so well and adding an aria-haspopup was used as sort of fallback to communicate something appeared on the page.

For sure, it's not a state: it's a property and its value shouldn't change.

Worth noting in the new ARIA 1.1 (still a Candidate Recommendation) things are a bit different and aria-haspopup will have some new values including "listbox". However, a combobox already has an implicit aria-haspopup property so it shouldn't be explicitly set, see:
https://www.w3.org/TR/wai-aria-1.1/#combobox

Elements with the role combobox have an implicit aria-haspopup value of listbox.

@moroshko
Copy link
Owner

@afercia Cool, let's remove aria-haspopup then.
Mind creating a PR?

@sidoruk-sv
Copy link
Contributor

@moroshko Hi!
Did I understand correctly that it should be just deleted?

@moroshko
Copy link
Owner

moroshko commented Oct 6, 2017

yeah

@sidoruk-sv
Copy link
Contributor

@moroshko can you review #36 please

@moroshko
Copy link
Owner

Done.

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

No branches or pull requests

3 participants