[Autocomplete] shows zero[0] in input when we clear the input programmatically
See original GitHub issueIn some cases after I select suggestion 0
appears in the input and kinda breaks the process.
- 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 use inputValue/onInputChange
because I want let user to also add custom values so I enabled freeSolo
and filterOptions
, hence the typing value should be controlled and I should clear it whenever I want. Now the problem is with this set-up when I select an option and then I delete it, after re-selecting it the value 0
will be shown in the input and it kinda breaks after that.
Expected Behavior 🤔
I should be able to re-select a value as many as I want.
Steps to Reproduce 🕹
Here is link to CodeSandBox
(freeSolo
and filterOptions
are not enabled for simplicity)
Steps:
- Select Radiohead for instance.
- Click on Radiohead to delete it.
- Re-select Radiohead and you’ll see the problem
Context 🔦
Tech | Version |
---|---|
Material-UI | v4.9.10 |
Material-lab | 4.0.0-alpha.49 |
React | 16.13.1 |
Browser | Chrome / Firefox |
TypeScript | No |
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[Autocomplete] shows zero[0] in input when we clear ... - GitHub
In some cases after I select suggestion 0 appears in the input and kinda breaks the process. The issue is present in the...
Read more >vue.js - Vuetify clear autocomplete input programmatically
I'd would like to reset the autocomplete input with another btn like this pen instead of the clearable btn. I tried to add:...
Read more >How to turn off form autocompletion - Web security | MDN
This article explains how a website can disable autocomplete for form ... You can do this either for an entire form, or for...
Read more >How To Turn Off Autocomplete for Input - W3Schools
Learn how to disable autocomplete of an input field. Turn Off Autocomplete. Use the autocomplete attribute to turn off autocomplete for input fields: ......
Read more >HTML Standard
The value, along with the " = " character, can be omitted altogether if the value is the empty string. <!-- empty attributes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@erfansamieyan You need to control the value too, to clear it.
@oliviertassinari Yes you’re right. I had to add a new state and pass to component only for making it clear. It’s working now. Thanks