Skip to content

[Autocomplete] Triggers change event twice with "enter" #18344

@andiksetyawan

Description

@andiksetyawan
  • 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 😯

I have used Autocomplete with FreeSolo prop, but I have a problem. when I have typed the word in the textfield / input and then I press Enter, the textfield becomes blank (deleted text). What I want, the word doesn't disappear when I press enter, how do I fix this?

<Autocomplete
     freeSolo
     id="combo-box-demo"
     options={top100Films}
     getOptionLabel={option => option.title}
     style={{ width: 300 }}
     renderInput={params => (
       <TextField {...params} label="Combo box" variant="outlined" fullWidth />
     )}
   />

https://codesandbox.io/s/material-demo-k1uyh

Expected Behavior 🤔

If I type text in the textfield and then I press Enter, the text should not be lost or not deleted

Your Environment 🌎

Tech Version
Material-UI v4.6.1
React 16.11.0
@material-ui/lab ^4.0.0-alpha.32

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGreat for first contributions. Enable to learn the contribution process.scope: 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