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

Fixed incorrect scrolling to index on pager appearance #175

Merged
merged 2 commits into from
Sep 30, 2018

Conversation

mlarandeau
Copy link
Contributor

Issue Replication:

  1. Begin to page to a new index but then stop the gesture early so that the pager stays on the current index
  2. Present and dismiss a view controller over the pager
  3. The pager will now be at the index that you had started to move to, but not the index that you ended at.

Cause:
expectedTransitionIndex on PageboyViewController is set when the user begins the paging gesture, however, the expectedTransitionIndex is never cleared and the currentIndex is never updated if the user cancels the gesture. Therefore, when scrollToPage is triggered on viewWillAppear, the expectedTransitionIndex does not match the currentIndex and therefore the pager switches pages even though that is not the intention of the user.

Fix:
expectedTransitionIndex is set to nil at the end of the paging/scrolling process.

Michael LaRandeau and others added 2 commits September 27, 2018 11:25
Copy link
Member

@msaps msaps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, cheers! 👍

@msaps msaps merged commit 1c637a7 into uias:master Sep 30, 2018
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