Hey Akhilesh, Can you outline why you'd like to prevent clicks? Is it because some other user code may have installed a click listener you want to avoid or is it some native platform action (e.g. following a link) that you want to abort?
It would be great if you could just preventDefault in the tap event, unfortunately, tap is generated separately from click and is typically fired after it. As Daniel mentioned, we're investigating providing a relatively easy way to do this in PolymerGestures. On Thu, Oct 2, 2014 at 8:57 AM, 'Daniel Freedman' via Polymer < [email protected]> wrote: > Hi Akhilesh > > We don't currently have a strategy to prevent clicks. I can take a look at > what that would entail. > > Touch-action is only supposed to control scrolling and zoom, so making the > "none" value control clicks as well is a little outside the intended scope. > > What you can do for now is place a document wide, capturing click listener > that calls stopPropagation inside the "up" event handler, and then remove > that click handler when a click happens, or after a timeout. This is the > approach I am planning to evaluate. > I have been trying to figure out an easier way to prevent click events > from an element that listens for tap. This is more of an issue on touch > devices (iOS in particular). Here's an example: > http://jsbin.com/totuhoveguke/2/edit > > One solution is to attach another listener for touchend and then do > event.preventDefault(). This causes weird side-effects which I want to > avoid. Ideally my assumption was that when I am using touch-action = > "none", I will be able to avoid all default browser events. > > What's the best solution for such cases? > > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/6f3bb3d1-52cb-4b89-9424-2cfdec3139f2%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/6f3bb3d1-52cb-4b89-9424-2cfdec3139f2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/CAAUAVAgfxq6JQDX%2Bev%2BPtbuo48a2D780rZLP2VpQ_AJBujUxEQ%40mail.gmail.com > <https://groups.google.com/d/msgid/polymer-dev/CAAUAVAgfxq6JQDX%2Bev%2BPtbuo48a2D780rZLP2VpQ_AJBujUxEQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZi6eXy2A3E4rezb5inR04g_VqaNUKvfVLe54x82YPzLEQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
