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

Investigate aria-disabled vs disabled #4299

Open
bethcollins92 opened this issue Feb 4, 2022 · 6 comments
Open

Investigate aria-disabled vs disabled #4299

bethcollins92 opened this issue Feb 4, 2022 · 6 comments
Labels
Accessibility Triaged: new architecture Triaged, to be addressed in new architecture of the design system Triaged: v4 Triaged, to be implemented as part of Vanilla v4 WG: Validated Validate working group proposals

Comments

@bethcollins92
Copy link
Contributor

There are some accessibility issues with using the native browser disabled attribute, as it hides the element from Assistive Tech.

The general advice is to use aria-disabled attribute but this doesn't come with the functionality of actually making the button disabled, or any of the styles. We need to look into how important it is to move to using aria-disabled, as it would be a lot of work.

https://a11y-101.com/development/aria-disabled

@bartaz bartaz changed the title Investigate aria-dsiabled vs disabled Investigate aria-disabled vs disabled Feb 7, 2022
@bethcollins92
Copy link
Contributor Author

This article is super interesting https://axesslab.com/disabled-buttons-suck/

The main point is that we shouldn't be disabling buttons at all. (With aria-disabled or with disabled) but why?

  • They fool users into clicking
  • They are hard to see
  • They don’t give any feedback
  • They give design teams a reason to rush through error handling
  • They make users think
  • Disabled buttons disable disabled users

More evidence in this guide which states:

"It is a bad practice to disable buttons. Disabling the button prevents our chance to tell the user what is wrong. The user keeps clicking the button and is totally in the dark why nothing happens. Keep the button enabled. Let the user click the button. Then show the message why it can’t proceed."

What we should do instead - have them enabled and then show an error message when the user clicks them.

If you really, really want to indicate that a button is disabled, do some css magic and make it look a bit grey (but with sufficient contrasts). And then turn it green or blue when everything is filled in correctly. But keep the button enabled in the code at all times and put focus on an error message if it’s clicked and there’s something wrong.

@bethcollins92
Copy link
Contributor Author

Another interesting article: https://css-tricks.com/making-disabled-buttons-more-inclusive/

This article shares a lot of the same advice, that using disabled is the worst option, aria-disabled is second best and better still is to keep the button enabled and provide feedback on why the form can't be submitted

@bethcollins92 bethcollins92 added the WG: Proposal Working group proposals label Feb 8, 2022
@clagom clagom added WG: Validated Validate working group proposals and removed WG: Proposal Working group proposals labels Feb 9, 2022
@clagom
Copy link

clagom commented Feb 15, 2022

We discussed this issue in our Design Assembly today. It's a large task that has multiple repercussions across all our websites and applications. We are going to take some time to inform more ourselves on this matter, then I would like to organise a combined workshop across disciplines.

@bartaz
Copy link
Member

bartaz commented Sep 23, 2024

Triage: this would be a high effort to do it on current architecture. This should be part of accessibility considerations for new architecture.

@bartaz bartaz added Triaged: v4 Triaged, to be implemented as part of Vanilla v4 Triaged: new architecture Triaged, to be addressed in new architecture of the design system labels Sep 23, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/WD-15191.

This message was autogenerated

@bartaz
Copy link
Member

bartaz commented Oct 23, 2024

Related to: #4942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Triaged: new architecture Triaged, to be addressed in new architecture of the design system Triaged: v4 Triaged, to be implemented as part of Vanilla v4 WG: Validated Validate working group proposals
Projects
None yet
Development

No branches or pull requests

4 participants