mantaskaveckas / react-siema

ReactSiema Demo
https://kaveckas.github.io/react-siema/
89 stars 39 forks source link

DRY up mouse and touch event handlers #1

Closed newyork-anthonyng closed 7 years ago

newyork-anthonyng commented 7 years ago

By checking for the event object using (e.touches && e.touches[0]) || e, we can use the same code for the mouse and touch event handlers.

mantaskaveckas commented 7 years ago

Hi! Thanks for your contribution. I've tested your changes, but seems that it doesn't work on touch devices tho. I believe the problem is that onTouchEnd event doesn't provide touches anymore, so it messes up this.drag.end, which affects movement on updateAfterDrag.

I will take a look into it a bit more.