OnBlur not called in 2.11.0
See original GitHub issueDescribe the bug
The OnBlur callback does not appear to be being called in 2.11.0
To Reproduce Visit https://reactdatepicker.com/#example-onblur-callbacks-in-console and open the developer console
- Interact with the picker and select a date.
- No events are logged in the console.
- Click the input again (see the cursor is inside the input)
- Press tab. Blur event logged.
Expected behavior Blur callback to be called one the input has left focus.
Desktop (please complete the following information):
- OS: OSX Catalina
- Browser Chrome
- Version 79.0.3945.117
Additional context
The picker would blur when closed in 1.9.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:30
- Comments:22
Top Results From Across the Web
React on Blur not being called - Stack Overflow
The problem here is that the div you added the onBlur on never receives focus. This results in the onBlur not being fired...
Read more >React Hook Form - Controller onBlur not called - CodeSandbox
React Hook Form - Controller onBlur not called ... Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >ngBlur - AngularJS: API
Specify custom behavior on blur event. A blur event fires when an element has lost focus. Note: As the blur event is executed...
Read more >react-datetime/README.md - UNPKG
These dependencies are not installed along with react-datetime automatically ... for when the user clicks outside of the input, simulating a regular onBlur....
Read more >The difference between onBlur vs onChange for React text ...
onBlur is fired when you have moved away from an object without necessarily having changed its value. onChange is only called 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 Free
Top 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
still happening…
I’ve solved the issue with adding autoFocus as a prop:
So that once the datePicker clicked, the focus is set and onBlur will fire.