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

Scroll view behavior fix #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Scroll view behavior fix #77

wants to merge 2 commits into from

Conversation

jasonaibrahim
Copy link
Contributor

Current behavior

The scroll view will jump to the middle when a keystroke is received by the keyboard no matter where the scroll view currently is.

Fix

Remove calls to setNeedsLayout to avoid the scroll view from jumping

@rnystrom
Copy link
Member

@jasonaibrahim can you detail this bug a little more? I'm not sure I've seen it before. How do I repro?

@jasonaibrahim
Copy link
Contributor Author

@rnystrom sorry for slow replies, been travelling. i will put together a little demo repo in the next few days

@jasonaibrahim
Copy link
Contributor Author

Alright I have a demo repo up and able to reproduce.

Reproduce Issue

  1. Clone https://github.com/jasonaibrahim/MessageViewControllerScrollViewBugExample
  2. Pod install
  3. Open MessageViewControllerScrollViewBugExample.xcworkspace
  4. Run in any simulator or physical device
  5. Scroll down to the bottom of the scroll view so that "99" is the last item visible
  6. Tap into message view to open keyboard (make sure keyboard is visible on screen)
  7. Type a letter
  8. See the scroll view jump so now "91" is the last item visible

Fix

  1. rm -rf Pods
  2. open Podfile, change pod to pod 'MessageViewController', :git => 'https://github.com/jasonaibrahim/MessageViewController.git', :branch => 'scroll-view-behavior-fix'
  3. pod install
  4. Run steps 4-7 from above
  5. Scroll view no longer jumps

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

Successfully merging this pull request may close these issues.

2 participants