Skip to content

userEvent interactions hang (Test timed out in 5000ms) on 14.6.2/14.6.3 — likely related to focus/blur setter from #1265 #1323

Description

@Haman888

What

After upgrading @testing-library/user-event from 14.6.1 to 14.6.2/14.6.3 (React 19.2.8, jsdom 30.0.0, vitest 4.1.10), tests using userEvent.setup() + click/type/clear started hanging and hitting the default 5000ms test timeout. Reverting to exactly 14.6.1 (no other change) reliably fixes it — verified across multiple runs:

  • isolated file run: 5/5 pass (~1s setup) on 14.6.1 vs 4/5 hang (~50s+ setup) on 14.6.3
  • full 255-test suite: consistently green on 14.6.1, consistently failing the same subset on 14.6.2/14.6.3

Environment

  • @testing-library/user-event: 14.6.1 (works) vs 14.6.2/14.6.3 (hangs)
  • @testing-library/react: 16.3.2
  • react / react-dom: 19.2.8
  • jsdom: 30.0.0
  • vitest: 4.1.10
  • next.js: 16.3.0 (App Router)

Repro pattern

Every failing test: userEvent.setup()render(<Component/>)await user.click(...) → optionally await user.clear(input); await user.type(input, "..."). The one test in the same file that does NOT use userEvent at all passes consistently regardless of version.

Suspected cause

14.6.1→14.6.2 is the first npm-published version to include the focus/blur prototype patch from #1252/#1265 — npm was stuck on 14.6.1 for over a year due to broken CI publish (#1317), so this getter/setter patch on HTMLElement.prototype.focus/blur is reaching many consumers for the first time now, via what reads as a low-risk patch bump. Haven't isolated the exact mechanism, but the timing and symptom (hangs specifically on focus-triggering interactions) line up.

What would help

Confirmation whether this is a known interaction, and whether pinning to 14.6.1 is the recommended workaround for now. Happy to try building a minimal repro if useful — currently only observed inside a larger private app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions