Skip to content

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

@epmatsw

Description

@epmatsw

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions