Closed tylerjames closed 8 years ago
I found the line that is causing the tableview to jump to the top when you use the pan gesture do dismiss the keyboard.
Down near the bottom of - (void)slk_handlePanGestureRecognizer:(UIPanGestureRecognizer *)gesture
under the switch case case UIGestureRecognizerStateChanged:
there is this block:
if (self.isInverted) {
if (!self.scrollViewProxy.isDecelerating && self.scrollViewProxy.isTracking) {
self.scrollViewProxy.contentOffset = _scrollViewOffsetBeforeDragging;
}
}
else {
CGFloat keyboardHeightDelta = _keyboardHeightBeforeDragging-self.keyboardHC.constant;
offset.y -= keyboardHeightDelta;
self.scrollViewProxy.contentOffset = offset;
}
The line: self.scrollViewProxy.contentOffset = offset;
seems to be the culprit as the offset (for me) is (0,0) which forces the tableview to jump to the top.
Commenting out that line fixes the problem.
Interesting. Good catch! Will test it out.
Hey @tylerjames I wasn't able to repro. Which version are you using, and can you repro on iOS 9 and 8 consistently? Would you mind sharing a screencast to show how better reproduce this issue? That could be helpful to diagnose this.
Hi @dzenbot,
I probably won't get a chance to look at this again until the new year. It's entirely possible, however, that there are some other libraries and/or views that are causing conflicts with the SlackTextViewController. I find setting the tableViewHeader property and adding a UIRefreshControl can cause some strange behaviour in tables.
If I get a chance I'll try to reproduce with more info.
Closing this for now.
When scrolled to the bottom (non-inverted) if I bring up the keyboard by tapping the input bar the keyboard shows. Then if I try to dismiss the keyboard by using a pan gesture starting from above the text input bar the tableview will immediately be set to the very top position (the oldest message). It does not animate it just jumps all the way to the top.
This may be somehow associated with the fact that I'm using non-inverted mode, but I'm not sure.