testing-library / testing-library/user-event
Shift+Arrows does not move the selection as expected
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/s/quizzical-bas-ovqbr9?file=/src/App.test.js
Prerequisites
- Have an input with any contents
- Move so that it's not in the last position
- Press ArrowRight with Shift held down on the Keyboard.
Expected behavior
Arrow movement with the shift key pressed should start a selection, where selection start != selection end.
Actual behavior
Both selection start and selection end move to the right, there is no selection.
User-event version
14.2.0
Environment
+-- @testing-library/dom@8.13.0
+-- @testing-library/jest-dom@5.16.4
+-- @testing-library/user-event@14.2.0
+-- jest-environment-jsdom@28.1.0
Additional context
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 with the reproduction in the linked CodeSandbox, especially src/App.test.js, and run it with the stated user-event 14.2.0 setup. Trace the Shift+ArrowRight behavior for an input that is not at its last position; done means the movement creates a non-empty selection with different selection start and end positions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100