testing-library / testing-library/user-event
v14.6.0 breaks react-aria
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 258
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction example
https://codesandbox.io/p/github/dansul-WittGruppe/user-event-bug/main
Prerequisites
- Install react-aria
- use a react-aria component that uses
useFocusVisiblehook (e.g. Linear Progress) - wrap the component and import the wrapped component with
React.lazy - use the wrapped component in a test
Expected behavior
Test will pass.
Actual behavior
Test fails with TypeError: Cannot set property focus of [object HTMLElement] which has only a getter.
User-event version
14.6.0
Environment
Testing Library framework: @testing-library/react@16.2.0
JS framework: react@19.0.0
Test environment: vitest@3.0.7
DOM implementation: jsdom@26.0.0
Component Library: react-aria-components@1.6.0
Additional context
Version <14.6.0 are working well
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked CodeSandbox reproduction with the listed React, Testing Library, Vitest, jsdom, and react-aria versions, then compare its behavior with a user-event version before 14.6.0. Trace the focus-related path that produces the HTMLElement getter error; done means the reproduction test passes on v14.6.0 without breaking the documented setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100