Skip to content

keyboard show but textfield not moved above the keyboard #2105

Open
@JsonKit

Description

@JsonKit

I discovered an issue involving the following code in Controller A:

Image

In Controller A, there is a TextField. After bringing up the keyboard to input text and then dismissing it, we navigate to Controller B.

Controller B also contains a TextField. However, when the keyboard is brought up in Controller B, the TextField cannot be pushed above the keyboard, making it impossible to input text.

The root cause is that in the keyboardWillShow method, _kbFrame and oldKBFrame are equal, which prevents adjustPosition from being executed.

Image

The reason why _kbFrame and oldKBFrame are equal is as follows:

keyboardWillShow

Image

keyboardWillHide, enable is false, so _kbFrame can not reset CGRectZero

Image

should the following two lines of code be placed before the check for enable?
_kbFrame = CGRectZero;
[self notifyKeyboardSize:_kbFrame.size];

Metadata

Metadata

Assignees

No one assigned

    Labels

    onlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions