-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AutoComplete] TextField lost focus when options show on Firefox #2432
Comments
I change (auto-complete.jsx line:222) TextField 's onBlur from onBlur={() => {
if (this.focusOnInput && this.state.open)
this.refs.searchTextField.focus();
}} to onBlur={() => {
if (this.focusOnInput && this.state.open) {
this.refs.searchTextField.focus();
var _refs = this.refs;
setTimeout(function() {
_refs.searchTextField.focus();
}, 0);
}
}} then it works. |
@oliviertassinari What do think about this fix? Although I'd go with: onBlur={() => {
if (this.focusOnInput && this.state.open) {
const refs = this.refs;
setTimeout(() => {
if (refs.searchTextField) {
refs.searchTextField.focus();
}
}, 0);
}
}} It's a lot safer. |
Hum, why is this blur event triggered in the first place? |
@oliviertassinari blur event triggered every time menu pops. The menu will take the focus when it updates, which defocus the text input. This wasn't a perfect solution and I was planning to change it in the future. I suggest we should remove the onBlur eventually, which the nicer solution might be adding props in menus. I am quite busy this week, but I can work it out in 2 weeks if this hasn't resolved yet. This probably also related to #2418 |
Hey guys. Did this get resolved at some point ? |
Closed by #4783 |
And on MS Edge and chrome, it's ok.
The text was updated successfully, but these errors were encountered: