Skip to content

Wrong Selection when <input/> inside contenteditable is focused #1248

@ph-fritsche

Description

@ph-fritsche

Reproduction example

https://codesandbox.io/p/sandbox/nostalgic-sutherland-w2n2w8

Prerequisites

  1. Render <div contenteditable="true"><input/></div>
  2. Focus the HTMLInputElement

Expected behavior

The selection has one collapsed range at the position of the input element.

Actual behavior

The selection has no range.

User-event version

14.5.2

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