luster-io / impulse

Dynamic Physics Interactions for the Mobile Web

Home Page:http://impulse.luster.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hard evt.preventDefault() in Drag touch/mouse handlers

lolenko opened this issue · comments

https://github.com/luster-io/impulse/blob/master/lib/drag.js#L79
because of it i can't make only horizontal slider with live vertical page scroll.

My suggest - completely remove this lines from Drag _start, _move, _end methods. And leave it to the discretion of users.
Is not that why Drag instance generates events like move?

I'm really sorry for my english.

I think the reason for that was that chrome on android only fires touchmove once, unless evt.preventDefault is called. I'm not sure if that's still the case.

Yes, it is. But what can i do if i don't need to prevent browser native scroll(exactly this case i can't solve now) or default behavior of nested link or another control? If I need i have access to original event via drag.on('start', callback).

Put links in this(https://github.com/luster-io/demo-bounce-scroll) example and you will find what i mean on touch device. The links will not work! I agree it's not right.

If you prevent touchstart you also prevent all mouse events including click!