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

Dismiss on Drag causes problems #270

Open
phoney opened this issue May 15, 2018 · 2 comments
Open

Dismiss on Drag causes problems #270

phoney opened this issue May 15, 2018 · 2 comments

Comments

@phoney
Copy link

phoney commented May 15, 2018

I have a tableView with Dismiss on Drag set in the storyboard. If I 'drag to dismiss' the bottom contentInset is never restored after the keyboard goes away (and other weird things happen after that).

The keyboardRect in the keyboardWillHide notification always has a height of zero and the code in TPKeyboardAvoiding_keyboardWillHide ignores the notification in that case. If I tap in the tableView or close the keyboard another way things work normally. If I comment out the first four lines in TPKeyboardAvoiding_keyboardWillHide then things work normally even for 'drag to dismiss'

I'm observing this on an iPad on iOS 11.

Is it safe to comment out those four lines?

@fl034
Copy link

fl034 commented Aug 27, 2018

I'm having the same issue if I set the keyboardDismissMode to onDrag or interactive. After using the specific gesture to dismiss the keyboard, contentInsets are not being restored.

I did not try phoney's workaround

@AzamRahmat
Copy link

try this.
func textFieldDidEndEditing(_ textField: UITextField, reason: UITextFieldDidEndEditingReason) {

    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1){[weak self]  in
        self?.scrollView.contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants