diff --git a/components/time-picker/index.tsx b/components/time-picker/index.tsx index 25ff1df6c9..72073b30f0 100644 --- a/components/time-picker/index.tsx +++ b/components/time-picker/index.tsx @@ -60,6 +60,7 @@ export default class TimePicker extends React.Component { }; context: TimePickerContext; + timePickerRef: any; constructor(props) { super(props); @@ -97,6 +98,14 @@ export default class TimePicker extends React.Component { return timePickerLocale; } + saveTimePicker = (timePickerRef) => { + this.timePickerRef = timePickerRef; + } + + focus() { + this.timePickerRef.focus(); + } + render() { const props = assign({ format: 'HH:mm:ss' }, this.props); delete props.defaultValue; @@ -116,6 +125,7 @@ export default class TimePicker extends React.Component { return (