rc-calendar
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -69,8 +69,11 @@ /** @jsx React.DOM */ | ||
} else { | ||
this.setState({ | ||
value: value, | ||
open: false | ||
}, function () { | ||
self.refs.input.getDOMNode().focus(); | ||
}); | ||
// avoid weird click fired on input | ||
setTimeout(function () { | ||
self.setState({ | ||
value: value, | ||
open: false | ||
}, function () { | ||
self.refs.input.getDOMNode().focus(); | ||
}); | ||
}, 0); | ||
} | ||
@@ -134,5 +137,5 @@ if (!currentValue || currentValue.getTime() !== value.getTime()) { | ||
var value = state.value; | ||
var calendar = state.open ? props.calendar : null; | ||
if (calendar) { | ||
calendar = cloneWithProps(calendar, { | ||
var calendar = this._cacheCalendar; | ||
if (state.open) { | ||
this._cacheCalendar = calendar = cloneWithProps(props.calendar, { | ||
ref: 'calendar', | ||
@@ -143,3 +146,3 @@ value: value, | ||
onBlur: this.handleCalendarBlur, | ||
onSelect: createChainedFunction(this.handleCalendarSelect, calendar.props.onSelect) | ||
onSelect: createChainedFunction(this.handleCalendarSelect, props.calendar.props.onSelect) | ||
}); | ||
@@ -153,4 +156,3 @@ } | ||
ref: 'input', | ||
// wield call onClick when open false | ||
disabled: true, | ||
readOnly: true, | ||
onClick: this.handleInputClick, | ||
@@ -160,3 +162,7 @@ value: inputValue, | ||
}); | ||
return <span className={props.prefixCls}>{[input, calendar]}</span>; | ||
var classes = [props.prefixCls]; | ||
if (state.open) { | ||
classes.push(props.prefixCls + '-open'); | ||
} | ||
return <span className={classes.join(' ')}>{[input, calendar]}</span>; | ||
} | ||
@@ -163,0 +169,0 @@ }); |
{ | ||
"name": "rc-calendar", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "calendar ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130796
3065