Skip to content

How to remove focus once selected #4311

Answered by ebonow
AndreaBarghigiani asked this question in Q&A
Discussion options

You must be logged in to vote

Greetings @AndreaBarghigiani ,

Have you tried the blurInputOnSelect prop as it sounds like what you are looking for?

If you wanted to use the blur method programmatically instead, you would want to use a react ref like so:

selectRef = react.createRef();

onChange= option => {
  this.setState({});
  selectRef.current.blur();
}

render () {
  return <Select ref={this.selectRef} onChange={this.onChange} />
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@AndreaBarghigiani
Comment options

@ebonow
Comment options

@AndreaBarghigiani
Comment options

Answer selected by AndreaBarghigiani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants