davidaurelio / TouchScroll

TouchScroll is a JavaScript- and CSS 3-based scroller for devices using Webkit Mobile. It is meant to mimic “native” scrolling feeling and behavior as much as possible.
http://uxebu.com/blog/2010/04/27/touchscroll-a-scrolling-layer-for-webkit-mobile/
BSD 2-Clause "Simplified" License
474 stars 61 forks source link

Multiple clicks registered, and fired, within #scroller... #19

Open hackcess opened 13 years ago

hackcess commented 13 years ago

Nobody seems to notice this "bug" so it probably isn't. But here's my issue:

In the demo there are some inline href links within the text (inside the #scroller div). Links at this level appear to receive 2 clicks.

Simply add a "_blank" as the target and every link will open 2 browser windows. Links OUTSIDE the #scroller work fine. For example, find the following:

<a href="http://uxebu.com/blog"> our blog</a>

And replace with:

<a href="http://uxebu.com/blog" target="_blank"> our blog</a>

... 2 browser windows will load. The exact same thing happens if you try to put some inline javascript (onClick) to call js functions—but only if your link is within #scroller.

If I'm "doing it wrong" it's non-obvious to me what it can be.

voxpelli commented 13 years ago

My guess is that this is due to the clickEvent that TouchScroll throws at touchEnd: https://github.com/davidaurelio/TouchScroll/blob/master/src/touchscroll.js#L596