Troubles with focus
Hello @JedWatson, You posted an example of how to set programatically the focus on a Select:
focusStateSelect () {
this.refs.stateSelect.focus();
}
<Select ref="stateSelect" autofocus options={options} simpleValue
clearable={this.state.clearable}
name="selected-state" disabled={this.state.disabled} value={this.state.selectValue}
onChange={this.updateValue} searchable={this.state.searchable} />
Well it doesn't works for me. I used this very same code, almost, and as I said, doesn't work for me at all. It gives me an error which says focus is not a function instead.
Is there any other solution? Am I missing something? Thanks in advance.
Hi @soma83 sounds like a version issue. It's hard to say without looking at the rest of your code. Were you able to figure it out?
I just noticed this problem earlier today. It seems that the ref is not properly referenced in the example docs, re: States.
current state:
focusStateSelect () {
this.refs.stateSelect.focus();
}
expected state:
focusStateSelect () {
this.select.focus();
}
I just made a PR to resolve this issue re: example.
Hello -
In an effort to sustain the react-select project going forward, we're closing old issues / pull requests.
We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.
If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.
If you feel this issue / pull request is still relevant and you'd like us to review it, please leave a comment and we'll do our best to get back to you.