Skip to content
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

EarlGrey Failure - “Keyboard did not disappear after resigning first responder status” #56

Closed
janderson-primary opened this issue Mar 25, 2016 · 3 comments
Assignees

Comments

@janderson-primary
Copy link

This error occurs when attempting to use the action to type text into a textfield.

If you chain responder status between textfields, EarlGrey will fail, reporting that "Keyboard did not disappear after resigning first responder status". This is because when your client implementation immediately moves firstResponder to a new textfield, the keyboard will not disappear (nor should it).

This error occurs because EarlGrey checks for Auto Correction on the textfield, disables autocorrection on the textfield, and then calls "resignFirstResponder" followed by "becomeFirstResponder", in order to effect the change. If your app chains firstResponder status, then the first call to "resignFirstResponder" will cause your app to pass responder status to the next text field.

Inspecting the EarlGrey source, it looks like the issue could be on line 182 in GREYActions.m. Here, we aren't checking to see that auto correction status is actually on. So even if your text field doesn't use auto correction, this will always invoke "resignFirstResponder" followed by "becomeFirstResponder". We should actually check to make sure that the prior value was "on" before performing this dance.

@tirodkar
Copy link
Collaborator

Thanks a lot for bringing this to our attention. We currently have a fix in process for this. As a quick workaround, you could turn off Autocorrection Type from either the text field or the Settings?

@janderson-primary
Copy link
Author

hi @tirodkar - Unfortunately turning off autocorrection doesn't work. The reason is that regardless of the autocorrection type on the UITextField, it will be asked to resignFirstResponder, and then becomeFirstResponder.

I wasn't aware you guys had a fix in progress, so I created a PR. You can see what I am talking about here:

#57

Feel free of course to close the PR since you have something in the works :)

@tirodkar
Copy link
Collaborator

tirodkar commented May 2, 2016

@janderson-primary, the Pull Request is in. Feel free to tell us if you still experience any more issues. Closing this for now.

@tirodkar tirodkar closed this as completed May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants