Skip to content

keyboard: apply correct modifier state #1000

@ph-fritsche

Description

@ph-fritsche

Reproduction example

https://codesandbox.io/s/userevent-keyboard-modifiers-gt0n61?file=/src/App.test.js

Prerequisites

  1. Render and focus element
  2. Press modifer and other keys

Expected behavior

Modifiers like [ShiftLeft] switch on the appropriate modifier state before keydown and switch off the modifier state before keyup.

Modifier locks like [CapsLock] switch on the modifier state after the keydown and turn off the the modifier state after keyup.

Actual behavior

Shift modifier state is not applied. (shiftKey is applied correctly.)

CapsLock modifier state is switched like a non-lock key.

User-event version

14.3.0

Environment

Testing Library framework:

JS framework:

Test environment:

DOM implementation:

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions