fix #12475. Picker should get focus after selection.

This commit is contained in:
zombiej 2018-10-09 17:44:22 +08:00
parent 50b55f488e
commit e5cfef565b
3 changed files with 3 additions and 0 deletions

View File

@ -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) => {

View File

@ -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();

View File

@ -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) => {