-
Notifications
You must be signed in to change notification settings - Fork 83
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
Make disabled components focusable and hoverable #4585
Comments
|
Actually, unless I'm mistaken, we don't even have to remove the |
Yes, we still need to keep |
This issue would also be relevant for
The current workaround would be to wrap disabled component in a different element and set a tooltip for it. |
Just noting, that e.g. with buttons, it is possible to override the style using this in
|
An unwanted side-effect of that is that disabled button will then apply |
Horrible UX (open/close flicker) with Select as well, so not a generically viable solution. |
Having said that. @TatuLund 's idea seems to work really well for one customer of mine. They claim they have tested a huge range of components with the events enabled along the implementation above. Only Select, for them, exposed an unwanted flicker. Maybe an implementation with pointer events being enabled is not as hard as we think (bar the testing). |
From what I can tell, the following would need to be done to make disabled buttons focusable and hoverable:
The |
What is the problem?
Disabled components currently have
tabindex="-1"
, which removes them from the keyboard tab order, making them effectively un-focusable, and, as a side-effect, makes them effectively invisible to assistive technologies, thus bad for accessibility.The disabled state also applies the
pointer-events:none
css property, which disables hover/mouseover based functionality such as tooltips. This is unfortunate especially as tooltips are a convenient way to inform the user why a component (e.g. a Button) is disabled. Removing this would require some additional css and js to handle the pointer-inertness of the component, but enabled tooltip usage.Ideally this behavior would be configurable via a feature flag or a global property, so that applications for which it is desired to keep the current behavior could easily revert back to it.
Browsers
Screen Readers
The text was updated successfully, but these errors were encountered: