From e5cfef565bf11970a8e4d5b3eaadfa82fc0918b3 Mon Sep 17 00:00:00 2001 From: zombiej Date: Tue, 9 Oct 2018 17:44:22 +0800 Subject: [PATCH] fix #12475. Picker should get focus after selection. --- components/date-picker/RangePicker.tsx | 1 + components/date-picker/WeekPicker.tsx | 1 + components/date-picker/createPicker.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/components/date-picker/RangePicker.tsx b/components/date-picker/RangePicker.tsx index c3de4df83d..ef8dee362d 100644 --- a/components/date-picker/RangePicker.tsx +++ b/components/date-picker/RangePicker.tsx @@ -140,6 +140,7 @@ class RangePicker extends React.Component { formatValue(value[0], props.format), formatValue(value[1], props.format), ]); + this.focus(); } handleOpenChange = (open: boolean) => { diff --git a/components/date-picker/WeekPicker.tsx b/components/date-picker/WeekPicker.tsx index 009e749213..6255e9c122 100644 --- a/components/date-picker/WeekPicker.tsx +++ b/components/date-picker/WeekPicker.tsx @@ -64,6 +64,7 @@ class WeekPicker extends React.Component { this.setState({ value }); } this.props.onChange(value, formatValue(value, this.props.format)); + this.focus(); } clearSelection = (e: React.MouseEvent) => { e.preventDefault(); diff --git a/components/date-picker/createPicker.tsx b/components/date-picker/createPicker.tsx index dacfe6fc07..42582db666 100644 --- a/components/date-picker/createPicker.tsx +++ b/components/date-picker/createPicker.tsx @@ -80,6 +80,7 @@ export default function createPicker(TheCalendar: React.ComponentClass): any { }); } props.onChange(value, (value && value.format(props.format)) || ''); + this.focus(); } handleCalendarChange = (value: moment.Moment) => {