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

Remove scrollbars from swiping surface #20

Open
pyrsmk opened this issue Apr 12, 2016 · 4 comments
Open

Remove scrollbars from swiping surface #20

pyrsmk opened this issue Apr 12, 2016 · 4 comments

Comments

@pyrsmk
Copy link
Contributor

pyrsmk commented Apr 12, 2016

I don't know if it's intended, but I ran into a problem with my Horizon library. I'm listening to several events and Impetus is triggering swipe event even when the mouse is over the scrollbar. I currently fixed this by automatically measuring the scrollbar width and then listening to mousedown/mouseup to know if we're manually scrolling or not.

@yckart
Copy link

yckart commented Apr 12, 2016

I think this problem comes not from impetus itself. As I can see, you just attached it to the entire document, try to use another source.

@pyrsmk
Copy link
Contributor Author

pyrsmk commented Apr 13, 2016

That's the case for Horizon 3 but not for the upcoming Horizon 4. In the next release we'll be able to set any scene we want. So, if we have scrollbars on this scene, for any reason, the problem would be the same, isn't it?

@yckart
Copy link

yckart commented Apr 14, 2016

That sounds like a really specific edgecase and is maybe better to handle it in your own library... However, I'm not the maintainer, let's wait what @chrisbateman says.

Btw. there's no need to measure the scrollbar sizes, instead you could just compare the scrollable container with the current clicked target (requires that the scollarea completely fills its parent):

scrollable.addEventListener('mousedown', function(e) {
  var isScrollbar = this === e.target
})

@pyrsmk
Copy link
Contributor Author

pyrsmk commented Apr 14, 2016

We can't know in advance if the specified scene has scrollbars. Moreover, I just need to disable swiping when the mouse is over a scrollbar, and not a scrollable content. Because my library can listen to scroll events and swipe events at the same time (and many more). So I've got incompatibilities between scroll and swipe because both events are triggered and it shouldn't be the case.

But yeah, let's wait for @chrisbateman 's point of view. For the time, I'll put a fix in my library ^^

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