testing-library / testing-library/user-event

Missing `select` event on hidden documents

Open
#1,253 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
2.3k
Forks
258
PR merge metrics
No merged PRs in 30d

Description

Reproduction example

https://github.com/testing-library/user-event/blob/eb57890474ca9ff096bb7baadd25a6d5ee193022/tests/environment/select.ts#L15-L25

image

Prerequisites
  1. Render a form control with selection range (<input type="text">, <textarea>)
  2. Change selection in the form control
Expected behavior

A select event is dispatched.

Actual behavior

There is no select event if document.visibilityState is hidden.

User-event version

14.5.2

Environment

DOM implementation: Chromium 131.0.6778.204 built on Debian GNU/Linux 12 (bookworm)

Additional context

similar to #553

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 with tests/environment/select.ts at the linked lines and reproduce the selection change with document.visibilityState hidden in the stated Chromium environment. Done means the form control dispatches a select event in that hidden-document case, with the relevant test covering it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.