Skip to content

Text frame "jumps" on resignFirstResponder when not using UIReturnKeyDefault #297

@rholstad

Description

@rholstad

This can be observed using the provided sample application and making the following changes to TPKAScrollViewController

  • Modify the returnKeyType and set the delegate for each UITextField
textField.returnKeyType = UIReturnKeyDone;
textField.delegate = self;
  • Implement -(BOOL)textFieldShouldReturn:(UITextField *)textField to dismiss keyboard
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    return true;
}

Type in any field and click the Done button. The _UITextContentView frame jumps to the left briefly before returning to its original position.
ezgif com-gif-maker

This was introduced in build 1.2.4 by adding [self layoutIfNeeded] to -TPKeyboardAvoiding_keyboardWillShow: in commit f533c6c. I see that the issue this was intended to address was "Scrollview stuttering problem on content inset/offset change fixed." Removing this code fixes the text jumping when resigning first responder status, but what are the ramifications?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions