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

Cancelling? Using with Hammer.js #14

Open
grumpygary opened this issue Nov 29, 2017 · 3 comments
Open

Cancelling? Using with Hammer.js #14

grumpygary opened this issue Nov 29, 2017 · 3 comments

Comments

@grumpygary
Copy link

Using vue-pull-refresh (VPR) with hammer.js works well, but...

When panning left/right on a page with a VPR component, it would be nice to be able to tell VPR to cancel (resetPullDown) and have VPR stop processing events, but this is private to the mounted/$nextTick handler.

Exposing resetPullDown (I know it's not that simple) would allow both panning and VPR functionality to co-exist. Currently both work, but from a user perspective, once panning begins the VPR functionality should cease.

@grumpygary
Copy link
Author

I've implemented a patch that seems to work for me.

1 - At the beginning of "touchmove":
if (this.cancelPull) { this.pullDown.height = 0; } else

2 - At beginning of "touchstart":
this.cancelPull = false;

3 - Then, from the wrapped component, find VPR ($children[0]) and simply set vpr.cancelPull = true; -- the pull will be cancelled and the puller reset. From what I can tell, I don't think it matters how and when cancelPull gets set.

Works like a charm!

@lakb248
Copy link
Owner

lakb248 commented Dec 1, 2017

@garyskiba Maybe you can make a pull request ?

@grumpygary
Copy link
Author

grumpygary commented Dec 1, 2017 via email

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

2 participants