Datepicker closes after re-rendering component
only if you set property closeOnSelect={true}
- click into input field to open datepicker
- after re-rendering view caused by e.g. setState datepicker closes
- you have to click somewhere outside of input field first to re-open datepicker
Happens to me aswell.
Confirming
Datepicker closes if onFocus causes a re-render too, I suppose I'm facing the same issue.
Made a workaround by using Pure Render Mixin and wrapper component but it's not very convenient to use and doesn't help if wrapper component's props change when datepicker is open, but maybe this idea will help someone.
I'd be happy to see this bug fixed though.
@simeg guys when are you going to fix this issue? we need it to be fixed soon. thanks
@martinvondracek Hey,
If this is something urgent for you I recommend you to create a PR for it. Otherwise I'll look at it when I have the time. Thanks.
@martinvondracek, @Mistra, @sunnysingh & @AtomicAlienZ:
This has been fixed in version 2.8.4.
Hey guys, sorry but I had to revert the change I made for 2.8.4 (in 2.8.6) due to some other issues. If you're not experiencing any problems with 2.8.4 I recommend you to use that specific version until we can sort everything out. Thanks.
Hi there, Faced an issue related to this where clicking the input field for the first time, date picker opened. But when i click the input field again, it just closed. I cross verified it by using onBlur prop and saw that on clicking the input field when the date picker was open, it was going to onBlur method.
For a workaround, i downgraded to version 2.8.4. But there i got another problem where date picker did not close on date selection i.e. closeOnSelect didn't worked.
For that, i used a key prop for the Date Picker component and reset the key every time date is selected. This solved my issue of date picker not closing but date was also getting reset which i handled with the value prop of Date Picker Component by assigning selected value to a state and providing that state to component.
This is just a workaround if someone is stuck. Waiting for the updates to get through this problem. Thanks.
Yep, same for me (Chrome). When clicking on the input, picker opens, when clicking again on input in closes. After that, repetitive clicks to input do nothing. The only thing I can do to get it to open again is to click away from the component (blur) and then click the component again.
v2.9.0
Same problem here can't get to have both closeOnSelect and re-rendering to work at the same time.
on 2.8.4 closeOnSelect does not work, on 2.9.0 updating the state (on Focus for my own purpose) closes the date picker.
This should be fixed on 2.11.0. It will still close on an update but you can click on input to open again (without clicking outside).
How can I get this to work on my own input component in the renderInput function?