Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird focus behaviour wiht react-datepicker #1539

Closed
tume opened this issue Feb 7, 2017 · 7 comments
Closed

Weird focus behaviour wiht react-datepicker #1539

tume opened this issue Feb 7, 2017 · 7 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@tume
Copy link

tume commented Feb 7, 2017

There is already issue in react-datepicker: Hacker0x01/react-datepicker#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....

@karolis-sh
Copy link

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.

@ibcWillJust42
Copy link

same problem

@gilbertkaradja
Copy link

gilbertkaradja commented Mar 24, 2017

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

@swbullis
Copy link

swbullis commented Mar 24, 2017

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

@JedWatson
Copy link
Owner

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.

@theGABS
Copy link

theGABS commented May 10, 2018

+1

@bladey
Copy link
Contributor

bladey commented May 27, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

8 participants