impetus
impetus copied to clipboard
Multitouch kills Impetus
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](https://cloud.githubusercontent.com/assets/1995135/12214721/0a1764ca-b65d-11e5-8fb2-e205126e165f.png)
![screen shot 2016-01-08 at 11 03 54 pm](https://cloud.githubusercontent.com/assets/1995135/12214722/0a201caa-b65d-11e5-84d7-424ad842d75d.png)
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?
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!
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?
@jensHartfelt #33 fixes this. This fork contains the fix: https://github.com/Simbioz/impetus
@fortinmike Awesome, thanks! Just tested it, and it seems to be working perfectly!
Just for the record, the new pull request that fixes this is #44.