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

New rule: Don't allow aria-hidden on focusable elements #881

Closed
khiga8 opened this issue Jul 28, 2022 · 0 comments · Fixed by #888
Closed

New rule: Don't allow aria-hidden on focusable elements #881

khiga8 opened this issue Jul 28, 2022 · 0 comments · Fixed by #888

Comments

@khiga8
Copy link
Contributor

khiga8 commented Jul 28, 2022

Hi team. I'd like to propose a rule that flags when aria-hidden="true' is set on focusable elements or on elements with descendants that are focusable. The rationale is that aria-hidden should be reserved for elements that are non-interactive since assistive technology users can still reach interactive elements in keyboard even with aria-hidden="true". Setting aria-hidden="true" on focusable elements can lead to unexpected behavior or be confusing.

An exception for this rule could be if a tabindex="-1" is set to remove it from keyboard order or if it's an input element with disabled. (While this could be an exception, I don't think this is necessarily a "good" approach since it's questionable whether interactive elements should be considered decorative, to begin with)

I would consider the following as focusable elements: textarea, button, a, input, summary.

What do you think? Am I missing anything?

I'm happy to start a draft PR.

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.

1 participant