testing-library / testing-library/user-event

v14.6.0 breaks react-aria

Open
#1,277 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs assessment
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
  1. Install react-aria
  2. use a react-aria component that uses useFocusVisible hook (e.g. Linear Progress)
  3. wrap the component and import the wrapped component with React.lazy
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.