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

Page indices go out of sync if dragged past threshold and back #38

Open
kpuputti opened this issue Oct 17, 2012 · 6 comments
Open

Page indices go out of sync if dragged past threshold and back #38

kpuputti opened this issue Oct 17, 2012 · 6 comments

Comments

@kpuputti
Copy link

Can be reproduced in the project demo:

http://cubiq.org/dropbox/SwipeView/demo/gallery/

It take a few attempts, but if you drag the view past the threshold, then drag back just below the threshold (not all the way back), the page indices are updated but the shown view is still the same and is out of sync e.g. with the top indicators. I can already reproduce this every time and in our app this happens all the time by accident.

See screenshot, where the first image of the feed is shown, but the swipe indicator on the top highlights the last item:

Out of sync

Thanks!

@kpuputti
Copy link
Author

Same issue as #18, with proposed fix applied to the latest repo here: #39

@cubiq
Copy link
Owner

cubiq commented Oct 17, 2012

kudos just for the linux screenshot. I'll look into it. It must be a very stupid bug

@jhnns
Copy link

jhnns commented May 17, 2013

One possible workaround for this is (probably):

var previousPageIndex = gallery.pageIndex;

gallery.onFlip(function () {
    if (Math.abs(gallery.pageIndex - previousPageIndex) > 1) {
        gallery.goToPage(previousPageIndex);
        return;
    }

    previousPageIndex = gallery.pageIndex;
));

@jhnns
Copy link

jhnns commented May 17, 2013

This works only if loop is false of course.

@zthomas
Copy link

zthomas commented Dec 26, 2013

Looks like #39 has not been merged into master yet. It would be great if it was merged, thanks!

@cubiq
Copy link
Owner

cubiq commented Dec 26, 2013

the requested mod to #39 has not been applied... I'll work on this as soon as iScroll 5.1 is ready

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

4 participants