-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How to close the date picker? #503
Comments
What is the issue you are seeing? |
The issue I see, which might be the same issue, is that when you click into the input field, the datepicker is displayed. But the only way to hide the datepicker is to select a date -- if you click or tab out of the input field, the datepicker remains visible. Firefox 46.0.1 |
Sorry, I'm not seeing this issue; tried Firefox 43 and 47. Are there any console error messages, or can you create a sample app that shows the issue? |
@opusrocks, are you seeing the issue on the demo site? https://hacker0x01.github.io/react-datepicker/ |
No, I don't see the issue on the demo site. No errors logged to the console.. Hmm, I will have to troubleshoot more |
Cool; I think it's probably something going on in your app. One thing that comes to mind is that if events are stopped propagating by something, it could be preventing them from reaching the date picker and triggering the close |
I believe I have the same problem. import DatePicker from 'react-datepicker'
import moment from 'moment';
constructor(props) {
super(props);
this.state = {
selectedDate: moment()
};
}
handleChange(date) {
this.setState({selectedDate: date});
}
render() {
return (
<DatePicker
dateFormat='YYYY/MM/DD'
selected={this.state.selectedDate}
onChange={this.handleChange.bind(this)} />
);
} And I have several warnings regarding missing props, but according to the docs the only two props I need are
I have the following versions:
|
@lacerda can you try doing a clean install of all of your dependencies (i.e. delete |
@rafeememon I did that and I have the same problems. |
My bad, I created the project from scratch and all the problems are gone! |
Awesome! I'm going to close this for lack of other information to go on |
@lacerda @opusrocks Any luck on figuring out why this was happening? I'm having the same issue but can't seem to determine why. |
@njj all I did was a clean install like suggested by @rafeememon and it worked. Have you tried that? |
how to close the date picker
DatePicker selected={this.state.startDate} onChange={this.handleInputChange}/>
DatePicker selected={this.state.EndDate} onChange={this.handleInputChange2}/>
The text was updated successfully, but these errors were encountered: