Skip to content

[Autocomplete] Navigation event is triggered twice by IME #23044

@jiggum

Description

@jiggum
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Oct-14-2020 15-04-27

When the ArrowDown is pressed at IME composing state, the second below option is highlighted.
(This is not only for ArrowDown key. All of the below switch-case's each key has this problem)
https://github.com/mui-org/material-ui/blob/5c9c97675f3e7d3978e664520f3fbbe595c78eee/packages/material-ui/src/useAutocomplete/useAutocomplete.js#L662-L771

Expected Behavior 🤔

When the ArrowDown is pressed at IME composing state, the first below option should highlighted.

Steps to Reproduce 🕹

Steps:

  1. See https://codesandbox.io/s/material-demo-forked-bdu70
  2. Make IME on with character '가'
  3. Hit ArrowDown
  4. The second below option is highlighted

Context 🔦

This Problem is related to #19435.

To expected behavior, I think below whole swich-case statements should place under the if statement of

if (event.which !== 229)

https://github.com/mui-org/material-ui/blob/5c9c97675f3e7d3978e664520f3fbbe595c78eee/packages/material-ui/src/useAutocomplete/useAutocomplete.js#L662-L771

Your Environment 🌎

Tech Version
Material-UI v4.11.0
Material-UI Lab v4.0.0-alpha.56
React v16.13.1
Browser macOS, Chrome/85.0.4183.102

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready to takeHelp wanted. Guidance available. There is a high chance the change will be acceptedscope: autocompleteChanges related to the autocomplete. This includes ComboBox.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions