diff --git a/ui/js/component/form.js b/ui/js/component/form.js index 9a734f549..4db52e23d 100644 --- a/ui/js/component/form.js +++ b/ui/js/component/form.js @@ -105,6 +105,10 @@ export class FormRow extends React.PureComponent { return this._field.getOptions(); } + focus() { + this._field.focus(); + } + onFocus() { this.setState({ isFocus: true }); } diff --git a/ui/js/component/formField/view.jsx b/ui/js/component/formField/view.jsx index 0f2cd8761..16c73706c 100644 --- a/ui/js/component/formField/view.jsx +++ b/ui/js/component/formField/view.jsx @@ -124,6 +124,10 @@ class FormField extends React.PureComponent { this.props.onBlur && this.props.onBlur(); } + focus() { + this.refs.field.focus(); + } + render() { // Pass all unhandled props to the field element const otherProps = Object.assign({}, this.props),