Skip to content

TextInput prevents keydown from bubbling #2790

@vpzomtrrfrt

Description

@vpzomtrrfrt

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The TextInput component currently calls stopPropagation on every keydown event, with a reference to #612. This is a quite heavyhanded workaround to a niche problem, and prevents me from handling key events further up the tree

Expected behavior

TextInput should only stop propagation of relevant events (space?)

Steps to reproduce

  1. Add a View with a keydown handler
  2. Add a TextInput inside it
  3. Press a key (e.g. Escape) while the TextInput is focused

The containing View does not receive the event

Test case

https://codesandbox.io/p/sandbox/fragrant-brook-42hkcd

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions