Getting value onBlur
See original GitHub issueIs it possible to get the value of select on blur? Unlike onChange
onBlur
returns an event. So when I do something like e.target.value
I always get an empty string.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:8
- Comments:5
Top Results From Across the Web
Get value onblur from input fields in a loop - Stack Overflow
How would I get the value too? Normally I would just set a variable like usual but it's in a loop so I'm...
Read more >onblur Event - W3Schools
The onblur event occurs when an element loses focus. The onblur event is often used on input fields. The onblur event is often...
Read more >Focusing: focus/blur - The Modern JavaScript Tutorial
An element receives the focus when the user either clicks on it or uses the Tab key on the keyboard. There's also an...
Read more >Examples on How onblur Event Works in JavaScript - eduCBA
onblur is an in-built event that is available in JavaScript which gets triggered when the elements on which it is applied loses its...
Read more >.blur() | jQuery API Documentation
Description: Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. ... <input id="target" type="text" value="Field 1">....
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
You might want to slightly change this. OnBlur can trigger very quickly after onChange. setState is async call. So if you are calling changeHandler and then setState, there’s a good chance that you might have not received the value you have set in state for onBlur event. Try this scenario
But here you were expecting the state value which was set by OnChange
So you could first call setState and use the callback to trigger OnChangeHandler
+1