You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems a duplicate of #144 where we discussed this at length and decided not to do it.
TL;DR: disabled and aria-disabled have different semantics (e.g. disabled actually disables things from being interactive, and has stricter semantics on what it can be applied to). Conflating the two under the same custom matcher would be misleading.
Check out that discussion and let me know if you understand and agree on the reasons why.
I won't close it because my suggestion now would be to add a note about this in the README in the documentation for toBeDisabled to be explicit about it.
Describe the feature you'd like:
With a11y suggesting removing the native 'disabled' attribute, I was hoping
toBeDisabled
could check foraria-disabled
attribute to be true as well.Suggested implementation:
Adding a check for
aria-disabled
is true withinisElementDisabled
.Describe alternatives you've considered:
Currently we use
.toHaveAttribute('aria-disabled', 'true')
, but would be nice to be able to use.toBeDisabled()
Teachability, Documentation, Adoption, Migration Strategy:
Here are some links for more detail on
aria-disabled
:The text was updated successfully, but these errors were encountered: