-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
remove redundant ARIA roles from elements with implicit role #2245
Conversation
@metamoni thanks for bringing this up, made me more aware of accessibility bad practices. I found more references like the ones you edited in this PR in the codebase, do you think we should get rid of those too? From my limited understanding [1] [2], it seems the only appropriate use of ARIA in Administrate is |
@cabe56 I've removed all the I wasn't sure what this code did: <% if accessible_action?(resource, :show) %>
<%= %(tabindex=0 role=link data-url=#{polymorphic_path([namespace, resource])}) %> If this creates a No harm in keeping the one in the Search form ( Other than that, I think I removed all the references in this PR, but let me know if I've missed something 🤔 |
I had to read it several times to figure out it was adding attributes to the These rows usually have We could create another issue about removing this link role + styling as it takes more work and this PR is already a good addition to the codebase.
My bad, you are right. Went through all the references and you left just these related to the link that are going to take a bit more work to get rid of. |
That sounds like a good idea. It might require some rethinking/redesign. It sounds like you're just looking to create links inside a table. As long as you make sure the links are either simple Happy to take a look at the issue/PR when it's ready, so feel free to tag me. If you let me know what the steps are to get to the right page, I can pull the branch and test the behaviour with a keyboard and screen reader. |
Thank you so much for this! Re: that |
@pablobm thanks for the context. IMO this PR is good to go as @metamoni did not remove the We can deal with that specific With this PR merged and a new PR for |
Was about to write an update to the issue regarding my suggestion about another PR, but it seems that I overcomplicated this whole thing: could we just change the CSS selector from For example, if we just replace |
@pablobm Hmm thanks for the context, it's really useful to understand why this change was introduced. I get the intention behind it, but I don't think that behavior of tabbing through rows and cells that way is an established pattern. This article by Leonie Watson explains how real assistive tech users would navigate a table. Unfortunately, I think making non-interactive elements focusable would actually make for a confusing experience in this case. It's best to stick to semantic HTML and leave links as interactive elements, as assistive tech gives users various ways to navigate the page, navigate tables, find links, etc. |
Hi, as a blind user here, I confirm that putting a role=link in a tr breaks the table navigation commands for screen readers. |
Thank you all for your input! I agree that this PR is good to go. Merging. Re: the row links, it does seem that you are all right and the current implementation is counterproductive. @metamoni - Would you be able to create an issue as you propose? Then we can agree on a suitable alternative. |
What does this do?
Fixes #2244 by removing the
role
attribute from all HTML elements that have an implicit role.Why?
Because using the
role
attribute on HTML elements with implicit roles is bad practice.