Skip to content

Input field inside GridList #4674

@tflanagan

Description

@tflanagan

🐛 Bug Report

When using ListBox, if you have an <input type="text" /> element, when typing in the input field, space characters are being ignored.

🤔 Expected Behavior

Typing in the input field would work as normal without keyboard presses being intercepted.

😯 Current Behavior

When pressing the space bar with the <input> focused, ListBox assumes I am selecting the option row as opposed to typing into the input field.

💁 Possible Solution

  1. Detect current target of the event vs target of the state of selection manager and ensure they match, or
  2. Detect we are inside a user input field and ignore selection management

🔦 Context

DND Sortable list with user input

💻 Code Sample

https://codesandbox.io/s/great-sutherland-cqksy8?file=/src/App.js

Focus any of the <input type="text" /> fields, type some random characters, then try typing a space. The space will be ignored and if you look at the dom element, you'll see the data-pressed=true prop has been set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions