user-event icon indicating copy to clipboard operation
user-event copied to clipboard

Shift+Arrows does not move the selection as expected

Open edave64 opened this issue 3 years ago • 1 comments

Reproduction example

https://codesandbox.io/s/quizzical-bas-ovqbr9?file=/src/App.test.js

Prerequisites

  1. Have an input with any contents
  2. Move so that it's not in the last position
  3. 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/[email protected] +-- @testing-library/[email protected] +-- @testing-library/[email protected] +-- [email protected]

Additional context

No response

edave64 avatar Jun 03 '22 09:06 edave64

Thanks for opening an issue on this. It's one of our TODOs:

https://github.com/testing-library/user-event/blob/8215e2eebb13134cd0600cc8a2481725c16cd30d/src/utils/focus/selection.ts#L202-L203

ph-fritsche avatar Jun 03 '22 09:06 ph-fritsche