diff --git a/components/input-number/index.tsx b/components/input-number/index.tsx index 94d99814dd..e29ba71cc8 100644 --- a/components/input-number/index.tsx +++ b/components/input-number/index.tsx @@ -28,6 +28,8 @@ export default class InputNumber extends React.Component step: 1, }; + private inputNumberRef: any; + render() { const { className, size, ...others } = this.props; const inputNumberClass = classNames({ @@ -35,6 +37,14 @@ export default class InputNumber extends React.Component [`${this.props.prefixCls}-sm`]: size === 'small', }, className); - return ; + return this.inputNumberRef = c} className={inputNumberClass} {...others} />; + } + + focus() { + this.inputNumberRef.focus(); + } + + blur() { + this.inputNumberRef.blur(); } }