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

toBeDisabled to support aria-disabled #230

Closed
wongm3 opened this issue Apr 9, 2020 · 3 comments
Closed

toBeDisabled to support aria-disabled #230

wongm3 opened this issue Apr 9, 2020 · 3 comments

Comments

@wongm3
Copy link

wongm3 commented Apr 9, 2020

Describe the feature you'd like:

With a11y suggesting removing the native 'disabled' attribute, I was hoping toBeDisabled could check for aria-disabled attribute to be true as well.

Suggested implementation:

Adding a check for aria-disabled is true within isElementDisabled.

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:

@wongm3
Copy link
Author

wongm3 commented Apr 9, 2020

I would also like to attempt to add this feature, and will be looking to create a PR for this.

@gnapse
Copy link
Member

gnapse commented Apr 9, 2020

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.

@wongm3
Copy link
Author

wongm3 commented Apr 9, 2020

I think that makes sense and I will close out the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants