Open tbrebant opened 8 years ago
A possibly useful reminder ;)
touchstart ↔ mousedown
touchend ↔ mouseup
touchenter
touchleave ↔ mouseout
touchmove ↔ mousemove
touchcancel
Some thoughts for conversation tomorrow (typing from a phone, sorry)
(In your example you mention myDom.on('touchcancel', touchcancel);
but it should be myDom.on('dom.touchcancel', touchcancel);
)
Also I'm not really sure you understand when `touchcancel is triggered. This is not the role of WuiDom to simulate touch behavior from a mouse. Other than that I think WuiDom does already too much in therm of events.
If you want full support for both, this should be your app or a separate library do do the job.
Pointer events should be the way to go if you wanna go deeper and have more control. @polco wrote the following library if you wanna take a look: https://github.com/spur/events
yeah if you want something homogeneous, pointer events are the way to go: there is a simple polyfill by the way: https://github.com/jquery/PEP
What about implementing
touchcancel
? The mouse mapping would be useful and also make some code more homogeneous:I know it's not as easy as with other events and require a certain amount of logic, but I think it's possible, as in https://gist.github.com/Inviz/659843/85054839665e561cc0a24a878212f3ad4c661d67.
What do you think?