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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Role attribute and WAI-ARIA specs #6
Comments
Thanks for the well thought out comment. It may be time to demote the role |
(worth noting: I think the most practical conflict here is when you want to |
Moving forward, the new recommendation will be to use <!-- ok -->
<div class='user-info' data-js-avatar-popup>...</div>
$('[data-js-avatar-popup]').on('hover', function () { ... }) You may also add values to these attributes for more control... something the <button data-js-tooltip='Close'>...</button> Thanks for your help! |
The idea of making JS behaviors more understandable by using the role tag is really neat. 馃憤
But it conflicts with the current W3C WAI-ARIA 1.0 specification. Mostly this normative regarding the usage role of the attribute . In short the specs already categorizes roles that define user interface widgets and page structures.
So the following example would be incorrect by the specs:
But this one would not:
In the end the usage of the role attribute is not conceptually wrong by W3C definition:
Possible solutions
It is possible to keep using the role attribute but restricted it to WAI-ARIA roles: Solving the JS behaviors bound selectors abstraction dilemma and making the code compatible with screen readers. But would make impossible to create more than one selector for specifics behaviours.
The only solutions I see is either by using custom data attributes in a fancy way or by creating an specific class naming schema.
The text was updated successfully, but these errors were encountered: