fix: should close panel when click presetted ranges, close: #7747

This commit is contained in:
Benjy Cui 2017-10-17 13:57:39 +08:00
parent f26217b36f
commit 7841386fcd

View File

@ -123,9 +123,9 @@ export default class RangePicker extends React.Component<any, any> {
handleHoverChange = hoverValue => this.setState({ hoverValue });
setValue(value) {
setValue(value, hidePanel?) {
this.handleChange(value);
if (!this.props.showTime) {
if (hidePanel || !this.props.showTime) {
this.setState({ open: false });
}
}
@ -145,7 +145,7 @@ export default class RangePicker extends React.Component<any, any> {
return (
<a
key={range}
onClick={() => this.setValue(value)}
onClick={() => this.setValue(value, true)}
onMouseEnter={() => this.setState({ hoverValue: value })}
onMouseLeave={this.clearHoverValue}
>