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

role="text" should be valid #574

Closed
OZZlE opened this issue Mar 19, 2019 · 3 comments · Fixed by #828
Closed

role="text" should be valid #574

OZZlE opened this issue Mar 19, 2019 · 3 comments · Fixed by #828

Comments

@OZZlE
Copy link

OZZlE commented Mar 19, 2019

<div role="text"></div>

Throws error Elements with ARIA roles must use a valid, non-abstract ARIA role jsx-a11y/aria-role

It's a valid role plz see: https://axesslab.com/text-splitting/

@jnurthen
Copy link

role="text" is not a valid role in the ARIA spec.

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Oct 22, 2021

This might not have been a valid role in 2019 (or in 2021 per MDN...) but is a necessary workaround for VoiceOver bugs that have been wontfixed by Apple. See OP's link; I've had to do this on production in quite a few places.

I would be happy to send a PR for this, either as a built-in allowed option (my preference) or an opt-in rule option. LMK!

Edit: maybe the opt-in rule option would be a list of additional roles, to future-proof the rule for other, similar situations?

@ljharb
Copy link
Member

ljharb commented Oct 22, 2021

If it's not matching the spec, then it shouldn't happen by default - but it may be reasonable to add it as an option.

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

Successfully merging a pull request may close this issue.

4 participants