From d2ab828c50cf70eaa98f2ce446ff5e23feedece4 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Sun, 27 Aug 2017 20:38:53 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix=20dragging=20images,=20#567?= =?UTF-8?q?=20=20=20check=20for=20pointerType=20for=20Chrome=20Pointer=20E?= =?UTF-8?q?vents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐞 fix mobile Chrome dragging, #521 remove pointerdown as touchstart event --- js/drag.js | 10 +++------- sandbox/media.html | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/js/drag.js b/js/drag.js index 625040e2..d2098df3 100644 --- a/js/drag.js +++ b/js/drag.js @@ -162,20 +162,16 @@ proto.pointerDownFocus = function( event ) { } }; -var touchStartEvents = { - touchstart: true, - pointerdown: true, -}; - var focusNodes = { INPUT: true, SELECT: true, }; function getCanPointerDown( event ) { - var isTouchStart = touchStartEvents[ event.type ]; + var isTouchStart = event.type == 'touchstart'; + var isTouchPointer = event.pointerType == 'touch'; var isFocusNode = focusNodes[ event.target.nodeName ]; - return isTouchStart || isFocusNode; + return isTouchStart || isTouchPointer || isFocusNode; } proto.canPreventDefaultOnPointerDown = function( event ) { diff --git a/sandbox/media.html b/sandbox/media.html index e0d4c348..f74f3f85 100644 --- a/sandbox/media.html +++ b/sandbox/media.html @@ -142,7 +142,7 @@

media