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

feat(role-text): add role-text rule #2702

Merged
merged 4 commits into from
Jan 11, 2021
Merged

feat(role-text): add role-text rule #2702

merged 4 commits into from
Jan 11, 2021

Conversation

straker
Copy link
Contributor

@straker straker commented Dec 18, 2020

Add support for role=text only if the contents do not have focusable descendants. This is very similar to our new nested-interactive rule except that instead of focusing on interactive roles this focuses on making sure the text role is used in such a way that does not override the semantics of the children.

Now we could have made role=text also have childrenPresentational: true, but that means it would have thrown errors with the nested-interactive rule which didn't make much sense (it's not really an interactive component). This allows use to have its own rule page with an explanation on the proper use.

Also note that this allows role=text on any element that is allowed any role. This means you can do

<mark role="text">Hello</mark>

And it will pass. I figured this was fine since these elements do allow any role to begin with.

Closes issue: #1597

@straker straker requested a review from a team as a code owner December 18, 2020 17:27
doc/rule-descriptions.md Outdated Show resolved Hide resolved
lib/rules/aria-text.json Outdated Show resolved Hide resolved
lib/rules/aria-text.json Outdated Show resolved Hide resolved
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 this pull request may close these issues.

None yet

2 participants