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

Inconsistent behavior based upon scroll axis #49

Closed
dzahler opened this issue Jan 17, 2014 · 3 comments
Closed

Inconsistent behavior based upon scroll axis #49

dzahler opened this issue Jan 17, 2014 · 3 comments

Comments

@dzahler
Copy link

dzahler commented Jan 17, 2014

When scrolling horizontally (x) everything works as expected, but vertically (y) it doesn't.

I have images wrapped in anchors with their href set. If I click on an image and drag horizontally the scroll occurs and nothing else. If doing the same exact thing, but vertically, the mouse-down event allows a click event to bubble up to the anchor and the browser navigates to the href.

@theBull
Copy link

theBull commented Feb 12, 2014

I'm having issues with vertical scrolling as well, maybe not the same as the OP though.

I have a div that I only want to scroll horizontally, not vertically (similar to the netflix app). However, on mobile devices, when trying to swipe vertically anywhere inside my div will prevent the page from being scrolled altogether.

Could this be due to an overflow-x: scroll; overflow-y: hidden; issue in my CSS?

The expected functionality would be that in the case where a div is only scrollable horizontally, any vertical scrolling would cause the entire page to scroll normally. Any thoughts?

@davetayls
Copy link
Owner

This is currently being worked on see #33 and #36, we're currently working on a rewrite of a lot of the internals to make this easier to implement (see #52) basically there are some short term suggestions in the other issue threads but we need to implement a check for only starting the scroll after the user has moved a certain amount in the desired direction

@dzahler
Copy link
Author

dzahler commented Feb 17, 2014

To close the loop, I have found a workaround for this particular issue.

I've set a global flag to indicate that we are currently scrolling within the moved listener and clear it on stopped, in combination with a click event handler for all the anchors that returns false while moving, thereby canceling the click.

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

3 participants