chrisbateman / impetus

Agnostic utility for adding momentum to anything. It's like iScroll, except not for scrolling. Supports mouse and touch events.
chrisbateman.github.io/impetus
MIT License
487 stars 70 forks source link

Multitouch kills Impetus #13

Open timothyallan opened 8 years ago

timothyallan commented 8 years ago

I've got an app that has pinch to zoom enabled on a canvas element, and I noticed that my dragging of the canvas (controlled by Impetus), would just stop every now and then after pinch/zooming on my iPhone. No errors, just dead.

After some spelunking I've found that it's partially the onUp function receiving an event.id that is different then the pointer ID and never executing stopTracking(), never setting pointerActive to false, and never registering another onDown event.

I've attached 2 screens of an onMove followed immediately by an onUp which fails. Also, logged the pointerActive, event.id, and pointerID so you can see what's going on.

This doesn't happen all the time, it sometimes takes a few tries of finger pinch zoom mashing, but it happens 100% of the time...well you know what I mean ;)

screen shot 2016-01-08 at 11 03 28 pm screen shot 2016-01-08 at 11 03 54 pm
mdings commented 8 years ago

Experiencing the same issue here. Implementing impetus disallows the zoom on pinch behaviour on touch devies, which I need for accessibility. Is there any workaround yet?

fortinmike commented 7 years ago

Also getting this in Chrome on Windows w/ a multi-touch screen. In our case, impetus always breaks on the first pinch, even if Chrome is in kiosk mode with webpage pinch zoom disabled.

What's weird is that once the pinch is performed, all "move" events received in impetus have the same exact X/Y coodinates (those of the last touch). That is, events are received properly but the event themselves are always stuck at specific X/Y coordinates, in effect freezing impetus completely (can anyone confirm this in other setups?)

The rest of our app still works as expected, and opening Paint and touch drawing is OK (doesn't seem hardware related).

This led me to think that it's a bug in Chrome, which was seemingly confirmed by trying the latest Chrome Canary, which doesn't exhibit this. Impetus continues working after a pinch. However, seeing people having this issue on iOS makes me doubt it's 100% Chrome's fault... Some investigation might be in order!

jensHartfelt commented 6 years ago

I am also experiencing this on iOS 10. If i pinch on an element controlled by impetus, impetus will freeze and it seems like all scrolling is frozen hereafter. This happens for me in both Safari, Chrome and Firefox. I can't reproduce the error on an android device. Have anyone found a workaround?

fortinmike commented 6 years ago

@jensHartfelt #33 fixes this. This fork contains the fix: https://github.com/Simbioz/impetus

jensHartfelt commented 6 years ago

@fortinmike Awesome, thanks! Just tested it, and it seems to be working perfectly!

fortinmike commented 5 years ago

Just for the record, the new pull request that fixes this is #44.