mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
fix DatePicker[showTime] onChange, close #3523
This commit is contained in:
parent
1e5264bad7
commit
ea6a84d9cf
@ -4,6 +4,7 @@ import MonthCalendar from 'rc-calendar/lib/MonthCalendar';
|
|||||||
import RcDatePicker from 'rc-calendar/lib/Picker';
|
import RcDatePicker from 'rc-calendar/lib/Picker';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import assign from 'object-assign';
|
import assign from 'object-assign';
|
||||||
|
import omit from 'omit.js';
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
|
|
||||||
export interface PickerProps {
|
export interface PickerProps {
|
||||||
@ -51,7 +52,7 @@ export default function createPicker(TheCalendar) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const props = this.props;
|
const props = omit(this.props, ['onChange']);
|
||||||
const prefixCls = props.prefixCls;
|
const prefixCls = props.prefixCls;
|
||||||
const locale = props.locale;
|
const locale = props.locale;
|
||||||
|
|
||||||
@ -72,9 +73,9 @@ export default function createPicker(TheCalendar) {
|
|||||||
let calendarHandler: Object = {
|
let calendarHandler: Object = {
|
||||||
onOk: this.handleChange,
|
onOk: this.handleChange,
|
||||||
// fix https://github.com/ant-design/ant-design/issues/1902
|
// fix https://github.com/ant-design/ant-design/issues/1902
|
||||||
onSelect: (value) => {
|
onSelect: (value, cause) => {
|
||||||
if (!('value' in this.props)) {
|
if (cause && cause.source === 'todayButton') {
|
||||||
this.setState({ value });
|
this.handleChange(value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user