jit
jit copied to clipboard
Canvas Dragging on Mobile
Hi, Canvas dragging does not seem to be working on any of the available examples, when on mobile (at least iPad).
Is it possible to make it work on iPad?
I'm not sure what causes this [tested on mobiles, tablets] on the spacetree, but a quick and dirty way to make it work (as far as i can see) is to go to MouseEventsManager.attachEvents [in the non-minified file], and change the touch handlers as follows:
'touchstart': function(e, win) {
- that.handleEvent('TouchStart', e, win, that.makeEventObject(e, win));
+ that.handleEvent('MouseDown', e, win, that.makeEventObject(e, win));
},
'touchmove': function(e, win) {
- that.handleEvent('TouchMove', e, win, that.makeEventObject(e, win));
+ that.handleEvent('MouseMove', e, win, that.makeEventObject(e, win));
},
'touchend': function(e, win) {
- that.handleEvent('TouchEnd', e, win, that.makeEventObject(e, win));
+ that.handleEvent('MouseUp', e, win, that.makeEventObject(e, win));
}
How can this still be in issue 3 years later? Mobile panning doesn't work even in the basic examples: https://philogb.github.io/jit/static/v20/Jit/Examples/Spacetree/example1.html
Thanx LonMcGregor.
It's working with your modification. Does someone plan to fix this issue?
Also affected by this, a fix would be great! The workaround by @LonMcGregor works for me as well, though, thanks for that!