Weird focus behaviour wiht react-datepicker
There is already issue in react-datepicker: https://github.com/Hacker0x01/react-datepicker/issues/730
Posting here also because not certain which component should fix this.
I have repository for reproducing it here: https://github.com/tume/select-datepicker-conflict
You can see the issue when first opening the calendar and then switching to react-select. I have some more speculation about the cause in react-datepicker issue but it looks like to be problem with onBlur/mousedown event ordering if I'm correct. Would appreciate if you have any comments on this or how to fix it....
Same here:
"react-datepicker": "^0.40.0"
"react-select": "^1.0.0-rc.3"
Also focusing on ordinary input doesn't flicker, just react-select input produces this.
same problem
I am starting to think its a problem with react-select.
@gilbertKaradja I'm pretty sure you are right.
From what I can gather it looks like react-select is running event.stopPropagation() in handleMouseDown https://github.com/JedWatson/react-select/blob/master/src/Select.js#L330 which is preventing React-Datepicker from from getting notified https://github.com/Hacker0x01/react-datepicker/blob/master/src/datepicker.jsx#L181 that it has lost focus.
You can see the event propagate properly if you right-click (Granted you won't get focus) or if react-select is disabled.
I'm pretty sure this is an issue with the way react-datepicker is asynchronously refocusing the input when it is blurred. I don't totally understand the use case for that though, so it might be important to support. Will comment on that project to learn more.
+1
Hello -
In an effort to sustain the react-select project going forward, we're closing old issues / pull requests.
We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.
If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.
If you feel this issue / pull request is still relevant and you'd like us to review it, please leave a comment and we'll do our best to get back to you.