-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[TextField/Menu] Menu auto focus causes TextField to lose focus #4387
Comments
I'm hitting the same issue, TextField is losing focus. In my case, I have a SelectField with MenuItems. The SelectField doesn't have the disableAutoFocus property. Any other workarounds? |
On further investigation, it wasn't the SelectField. I had a Menu, that was part of a Drawer. Even though the Drawer was not open it was causing the issue. Setting disableAutoFocus as has been suggested resolved it. I should also note this was not an issue in Chrome desktop. It was only a problem on Cordova/Android (didn't check iOS). When touching the TextField the keyboard would come up then immediately go away (because the Menu was taking focus) and the TextField did not have focus so you effectively could not type in the TextField. |
oooohhh, jsut ran into same issue. took me aeons to debug ;-( |
We have been porting the component on the v1-beta branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it. |
Finally !!!! After spending hours on trying to debugging this and going all over the place in redux-forms this finally came to this which fixed the exact same issue for me too ! |
For those, who has no luck with previous suggestions - try this one
|
Hey There ! |
@sandbox4013 thanks ! Your suggiestion was my last hope and it worked ! |
Problem description
With a controlled
TextField
, the field loses focus when re-rendered in the precense of aMenu
component elsewhere that does not havedisableAutoFocus
set totrue
. Even if the menu is not open, and has not been interacted with.Steps to reproduce
TextField
to your appMenu
with nodisableAutoFocus
prop (this will default the prop to false)TextField
such that it takes focus, note that the underline appearsTextField
loses focus on re-renderMenu
so thatdisableAutoFocus
is set totrue
TextField
TextField
no longer loses focusVersions
The text was updated successfully, but these errors were encountered: