testing-library / testing-library/user-event

[keyboard] Can't trigger control+backspace

Open
#1,159 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Reproduction example

https://codesandbox.io/p/sandbox/xenodochial-snow-pcy89v?file=/src/App.test.js:12,1-14,31

Prerequisites
  1. Render input <input defaultValue="1234" />
  2. Try to apply "crtl+backspace" keyboard event to input:
user.keyboard('{Control>}{Backspace}{/Control}')
Expected behavior

Input value should be cleared

Actual behavior

Only one char from input's value is deleted

User-event version

14.5.0

Environment

Testing Library framework: @testing-library/react@14.0.0

JS framework: react@18.2.0

Test environment: jest@29.7.0

DOM implementation: jest-environment-jsdom@29.7.0

Additional context

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 with the linked CodeSandbox reproduction and inspect src/App.test.js, especially the user.keyboard call using Control and Backspace. Compare the observed deletion with the expected clearing of the input value, then verify the corrected behavior against the same reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.