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

[React 19] aria attributes on custom elements behave maybe incorrectly #32251

Open
epmatsw opened this issue Jan 28, 2025 · 0 comments
Open

[React 19] aria attributes on custom elements behave maybe incorrectly #32251

epmatsw opened this issue Jan 28, 2025 · 0 comments
Labels

Comments

@epmatsw
Copy link

epmatsw commented Jan 28, 2025

Summary

In React 18, passing aria-disabled={true} to a custom element serialized that value as "true". That seemed good and as far as I can tell worked as expected.

In React 19, that same code adds the aria-disabled attribute, but doesn't set it to anything. That doesn't work as well. It appears to me (although I'm not certain) that it breaks accessibility for these custom elements. It definitely breaks @testing-library/jest-dom's toBeChecked matcher with aria-checked (https://github.com/testing-library/jest-dom/blob/918b6fbcde10d4409ee8f05c6e4eecbe96a72b7a/src/to-be-checked.js#L31).

For these aria attributes that require strings instead of booleans to function properly, is this an intended change?

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

No branches or pull requests

1 participant