Dont't clear Input on onBlur
See original GitHub issueI noticed that when Select
is blurred, the onBlur
event clears the input text field: https://github.com/JedWatson/react-select/blob/master/src/Select.js#L215
How can I disable this behaviour and keep whatever the user has started typing ?
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
don't clear input on select using React-Select - Stack Overflow
The problem is if you want to use the React-Select and you want persistent input value that doesn't get cleared on select or...
Read more >react-select: Keep input value on blur and menu close
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >Focusing: focus/blur - The Modern JavaScript Tutorial
The focus event is called on focusing, and blur – when the element loses the focus. Let's use them for validation of an...
Read more >react hook form onblur not working - You.com | The AI Search ...
So you have to setup the defaultValues in your <App /> component for all your child forms. Also you don't need useEffect in...
Read more >HTMLElement.blur() - Web APIs - MDN Web Docs
The HTMLElement.blur() method removes keyboard focus from the current element. ... Remove focus from a text input ...
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
A little less hacky way would be to watch for the actual user-initiated input changes by checking the
action
argument of theonInputChange()
.Example:
If anybody else experienced the same problem I have written above, try this. The code below worked for me.