mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
remove unused compatibility code, fix #1902
This commit is contained in:
parent
6c8a7b7944
commit
a05b4e6747
@ -50,25 +50,6 @@ export default function createPicker(TheCalendar) {
|
||||
'ant-calendar-month': MonthCalendar === TheCalendar,
|
||||
});
|
||||
|
||||
let pickerChangeHandler = {
|
||||
onChange: this.handleChange,
|
||||
};
|
||||
|
||||
let calendarHandler = {
|
||||
onOk: this.handleChange,
|
||||
};
|
||||
|
||||
if (props.showTime) {
|
||||
pickerChangeHandler.onChange = (value) => {
|
||||
// Click clear button
|
||||
if (value === null) {
|
||||
this.handleChange(value);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
calendarHandler = {};
|
||||
}
|
||||
|
||||
const calendar = (
|
||||
<TheCalendar
|
||||
formatter={props.getFormatter()}
|
||||
@ -80,7 +61,7 @@ export default function createPicker(TheCalendar) {
|
||||
dateInputPlaceholder={placeholder}
|
||||
prefixCls="ant-calendar"
|
||||
className={calendarClassName}
|
||||
{...calendarHandler} />
|
||||
/>
|
||||
);
|
||||
|
||||
// default width for showTime
|
||||
@ -102,7 +83,7 @@ export default function createPicker(TheCalendar) {
|
||||
getCalendarContainer={props.getCalendarContainer}
|
||||
onOpen={props.toggleOpen}
|
||||
onClose={props.toggleOpen}
|
||||
{...pickerChangeHandler}
|
||||
onChange={this.handleChange}
|
||||
>
|
||||
{
|
||||
({ value }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user