Supporting disabled buttons leads to poor usability and accessibility

Created on 18 April 2019, over 5 years ago
Updated 31 May 2023, over 1 year ago

Problem/Motivation

There's research to prove that using disabled button elements is bad for usability and accessibility. For example, Disabled buttons suck provides a comprehensive explanation of why disabled buttons shouldn't be used, and what should be used to replace them.

The core problem is that when a button is disabled, the user won't know why it is disabled. Preventing actions could be still done by either not showing the button at all, or by showing the button as active, and after a user clicks a "disabled" button, the system would show an error including an explanation of why the action couldn't be triggered.

At the moment, we support the disabled state by specifically adding classes to buttons based on disabled state. We also provide styles for the disabled state in our themes.

Proposed resolution

Deprecate disabled state for buttons in Drupal 8.8.0 and explain that all explicit support for them will be removed in Drupal 9. Since we don't want to be on the way of people, people should be still allowed to pass in the attribute buttons but it wouldn't be supported by Drupal themes out of the box. This way people would be still able to achieve the same end result in custom projects, but we discourage contrib projects and core from using this pattern.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Theme 

Last updated about 11 hours ago

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024