darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

Fix touch on Internet Explorer #178

Closed rbrochot closed 9 years ago

rbrochot commented 9 years ago

This simple fix allows Sly to work on IE on touch devices

darsain commented 9 years ago

Even if this works, it is not correct. You can't have empirical code dude.

waht

Dragging has to be enabled only when Sly instance direction matched the dragging direction.

When dragging paths (x & y) are equal, it means user is dragging in 45 degree direction, and Sly should ignore it. If these paths can be equal when user is dragging horizontally, they can also be equal when they are dragging vertically, which breaks the whole point of this conditional statement.

I'm more interested in knowing why is this even happening. Usually (mouse/touch)move events are triggered for every pixel moved. This means that moving from A1 to B2 in here:

    1   2
   --- ---
A |   |   |
   --- ---
B |   |   |
   --- ---

Would trigger 2 events, as your movement is:

A1 -> (A2 || B1) -> B2

IE is probably merging multiple events into one. Or maybe something else is happening. Can't tell. I'd need an IE touch device :/


Also, this PR wouldn't be merged anyway. You can't build dist, bump versions, or do similar stuff in PRs. It creates messy history of irrelevant changes (in case of building) and incorrect repository states (in case of bumps).

Apart of the code, the only things that belong into a PR are tests and documentation updates when necessary.


I'm closing this. Please move the conversation back to #164.