Skip to content

Typing Backspace multiple times results in wrong cursor position #1056

@JesseCheng77

Description

@JesseCheng77

Reproduction example

https://codesandbox.io/s/elastic-surf-6qegdh?file=/src/App.test.js

Prerequisites

  1. Render <input type="text" />
  2. Type abc
  3. Press {ArrowLeft}{Backspace}{Backspace}

Expected behavior

input element value should be 'c' and cursor position should be 0

Actual behavior

The input element value is "a" and the cursor position is 1

User-event version

14.4.3

Environment

Testing Library framework:

JS framework:

Test environment:

DOM implementation:

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions