mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 13:08:41 +08:00
fix #12475. Picker should get focus after selection.
This commit is contained in:
parent
50b55f488e
commit
e5cfef565b
@ -140,6 +140,7 @@ class RangePicker extends React.Component<any, RangePickerState> {
|
|||||||
formatValue(value[0], props.format),
|
formatValue(value[0], props.format),
|
||||||
formatValue(value[1], props.format),
|
formatValue(value[1], props.format),
|
||||||
]);
|
]);
|
||||||
|
this.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOpenChange = (open: boolean) => {
|
handleOpenChange = (open: boolean) => {
|
||||||
|
@ -64,6 +64,7 @@ class WeekPicker extends React.Component<any, any> {
|
|||||||
this.setState({ value });
|
this.setState({ value });
|
||||||
}
|
}
|
||||||
this.props.onChange(value, formatValue(value, this.props.format));
|
this.props.onChange(value, formatValue(value, this.props.format));
|
||||||
|
this.focus();
|
||||||
}
|
}
|
||||||
clearSelection = (e: React.MouseEvent<HTMLElement>) => {
|
clearSelection = (e: React.MouseEvent<HTMLElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -80,6 +80,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
props.onChange(value, (value && value.format(props.format)) || '');
|
props.onChange(value, (value && value.format(props.format)) || '');
|
||||||
|
this.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCalendarChange = (value: moment.Moment) => {
|
handleCalendarChange = (value: moment.Moment) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user