Skip to content

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

Merged
straker merged 4 commits intodevelopfrom
role-text
Jan 11, 2021
Merged

feat(role-text): add role-text rule#2702
straker merged 4 commits intodevelopfrom
role-text

Conversation

@straker
Copy link
Copy Markdown
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
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.

2 participants