Permalink
Browse files

MDL-37528 Libraries: Fix gesture + mouse issues with YUI

This addresses issues with devices which support both mouse and gesture
input devices whereby the presence of gesture support on the device causes
mouse interactions to be ignored.

This has the potential to cause issues with multiple events being triggered
for the same action, but we do not have this issue in core, and few
third-party plugins support drag and drop in such a way that this may be an
issue.

This is fixed in the latest version of YUI in a similar way, and the
addition of a new system to only trigger the event from the first action to
be triggered.
  • Loading branch information...
1 parent 22084d5 commit 75da763cd990ecfdbbf1a6f78b81898becf69a27 @andrewnicols andrewnicols committed Oct 10, 2013
@@ -140,10 +140,10 @@ if (Y.Node.DOM_EVENTS) {
//Add properties to Y.EVENT.GESTURE_MAP based on feature detection.
if ((win && ("ontouchstart" in win)) && !(Y.UA.chrome && Y.UA.chrome < 6)) {
- GESTURE_MAP.start = "touchstart";
- GESTURE_MAP.end = "touchend";
- GESTURE_MAP.move = "touchmove";
- GESTURE_MAP.cancel = "touchcancel";
+ GESTURE_MAP.start = ["touchstart", "mousedown"];
+ GESTURE_MAP.end = ["touchend", "mouseup"];
+ GESTURE_MAP.move = ["touchmove", "mousemove"];
+ GESTURE_MAP.cancel = ["touchcancel", "mousecancel"];
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -134,10 +134,10 @@ if (Y.Node.DOM_EVENTS) {
//Add properties to Y.EVENT.GESTURE_MAP based on feature detection.
if ((win && ("ontouchstart" in win)) && !(Y.UA.chrome && Y.UA.chrome < 6)) {
- GESTURE_MAP.start = "touchstart";
- GESTURE_MAP.end = "touchend";
- GESTURE_MAP.move = "touchmove";
- GESTURE_MAP.cancel = "touchcancel";
+ GESTURE_MAP.start = ["touchstart", "mousedown"];
+ GESTURE_MAP.end = ["touchend", "mouseup"];
+ GESTURE_MAP.move = ["touchmove", "mousemove"];
+ GESTURE_MAP.cancel = ["touchcancel", "mousecancel"];
}

0 comments on commit 75da763

Please sign in to comment.