Autocomplete with clearOnBlur doesn't clear value on blur
See original GitHub issue- 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 😯
Autocomplete
with clearOnBlur
set to true
doesn’t seem to clear the value on blur.
Expected Behavior 🤔
Autocomplete
with clearOnBlur
set to true
clears the value on blur.
Steps to Reproduce 🕹
Can be reproduced on the official playground, see https://material-ui.com/components/autocomplete/#playground. I have also created a codesandbox example here.
Steps:
- Open an autocomplete with
clearOnBlur
set totrue
- Select an option
- Click outside to blur the autocomplete
- The selected value doesn’t get cleared
Context 🔦
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.13 |
Material-UI lab | 4.0.0-alpha.52 |
React | v16.9.0 |
Browser | All |
TypeScript | 3.6.2 |
etc. |
Thank you for your help! 🙂
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Autocomplete with clearOnBlur doesn't clear value on blur
Open an autocomplete with clearOnBlur set to true · Select an option · Click outside to blur the autocomplete · The selected value...
Read more >Material UI Autocomplete clearOnBlur clears when false
Show activity on this post. In a recent project, I am using Material UI's Autocomplete. There I do not want the input field...
Read more >AutoComplete - Ant Design
AutoComplete is an input box with text hints, and users can type freely. The keyword is aiding input. Select is selecting among given...
Read more >Autocomplete API - Material UI - MUI
Name Type Default
options * array
renderInput * func
autoComplete bool false
Read more >react hook form onblur not working - You.com | The AI Search ...
In your code, the form mode is onBlur . it means the validation is triggered on blur event (unfocus the input). When you...
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
@MargaretKrutikova You could control the inputValue state, clear the text bases on the events you need. @JitendraBhamidipati thanks for the help 🙏.
Yes, exactly. When the user selects the value, we add it as a row in a table under it (with recalculating some values), but don’t want to actually show anything as selected. Appreciated help on this! 🙂