react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Weird focus behaviour wiht react-datepicker

Open tume opened this issue 9 years ago • 7 comments

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....

tume avatar Feb 07 '17 18:02 tume

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.

karolis-sh avatar Feb 10 '17 07:02 karolis-sh

same problem

ibcWillJust42 avatar Mar 07 '17 07:03 ibcWillJust42

I am starting to think its a problem with react-select.

gilbertkaradja avatar Mar 24 '17 09:03 gilbertkaradja

@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.

swbullis avatar Mar 24 '17 18:03 swbullis

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.

JedWatson avatar Sep 12 '17 12:09 JedWatson

+1

theGABS avatar May 10 '18 20:05 theGABS

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.

bladey avatar May 27 '20 06:05 bladey