Skip to content

Commit

Permalink
Add focus setting when opening the circle column
Browse files Browse the repository at this point in the history
  • Loading branch information
noellabo committed Sep 5, 2020
1 parent a84f680 commit 9784f8b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class NewCircleForm extends React.PureComponent {
onSubmit: PropTypes.func.isRequired,
};

componentDidMount() {
this.input.focus();
}

handleChange = e => {
this.props.onChange(e.target.value);
}
Expand All @@ -45,6 +49,10 @@ class NewCircleForm extends React.PureComponent {
this.props.onSubmit();
}

setRef = (c) => {
this.input = c;
}

render () {
const { value, disabled, intl } = this.props;

Expand All @@ -62,6 +70,7 @@ class NewCircleForm extends React.PureComponent {
disabled={disabled}
onChange={this.handleChange}
placeholder={label}
ref={this.setRef}
/>
</label>

Expand Down

0 comments on commit 9784f8b

Please sign in to comment.