Skip to content

Input defaults to previously entered value when dropdown clicked #5378

@JaundiceJack

Description

@JaundiceJack

When using react-select to select between values, clicking the dropdown, entering a value with 2 or more characters, and then entering a value with only the first character, the select defaults to the previously entered value.

For example, in a select with options 1 to 50, click the dropdown, type 20 and press enter to select 20. Then click the dropdown, type just 2 and press enter. The select component will have defaulted to 20 instead of the entered value of 2.

When the select component is highlighted by tabbing into it and a value is entered, the first option is focused and submits normally. Clicking the dropdown instead, removes the focus from the first option. This causes it to submit as the previously selected option if the entered value's first character matches the previously selected ones'.

After having selected Green,
TABBING into the component and typing highlights the first matching option:
Screenshot from 2022-10-13 12-01-05

CLICKING the component and typing highlights only the previously selected option:
Screenshot from 2022-10-13 12-00-31

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions