Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Stop vertical snap from creating pages past the scrollable range. #1134

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

Conversation

RHM-DanielKlier
Copy link

Hi there,

this pull request fixes an issue with the snap feature in vertically scrolled lists where you could increase the page counter past the scrollable range using next() or the mouse wheel.
I attached a demo page with a fairly minimal test case.

The setup is this:

  • The list has 10 vertical elements, but there is only room to show 5.
  • iScroll is created with snap on li and mouseWheel.
  • The links on the right can be used to scroll to the previous/next page.

Initially, the page count starts at 0. You can scroll 3 times until you reach the end of the list. The page count is now at 3 but subsequent clicks on "Next" will increase the page count up to 9 so that you would have to click "Prev" multiple times before the list actually scrolls up one element again.

Cheers
Daniel

Attachment: Demo page. Extract next to the other demos.
snap-max-scroll.zip

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

Successfully merging this pull request may close these issues.

None yet

1 participant