Skip to content

Commit

Permalink
fix ant-design#12475. Picker should get focus after selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Oct 9, 2018
1 parent 50b55f4 commit e5cfef5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/date-picker/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class RangePicker extends React.Component<any, RangePickerState> {
formatValue(value[0], props.format),
formatValue(value[1], props.format),
]);
this.focus();
}

handleOpenChange = (open: boolean) => {
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/WeekPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class WeekPicker extends React.Component<any, any> {
this.setState({ value });
}
this.props.onChange(value, formatValue(value, this.props.format));
this.focus();
}
clearSelection = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/createPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit e5cfef5

Please sign in to comment.