From de2fc7a4f4dfd48d830e3134f9bae86bd098e73f Mon Sep 17 00:00:00 2001 From: Daniel Acosta Date: Mon, 27 Dec 2021 17:50:25 -0500 Subject: [PATCH] Fix mouse functionality on touch devices. --- src/view/View.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/view/View.js b/src/view/View.js index 75d4720d19..4ec88f5d73 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -1076,18 +1076,9 @@ new function() { // Injection scope for event handling on the browser mousemove = 'pointermove MSPointerMove'; mouseup = 'pointerup pointercancel MSPointerUp MSPointerCancel'; } else { - mousedown = 'touchstart'; - mousemove = 'touchmove'; - mouseup = 'touchend touchcancel'; - // Do not add mouse events on mobile and tablet devices - if (!('ontouchstart' in window && navigator.userAgent.match( - /mobile|tablet|ip(ad|hone|od)|android|silk/i))) { - // For non pointer events browsers and mixed browsers, like chrome - // on Windows8 touch laptop. - mousedown += ' mousedown'; - mousemove += ' mousemove'; - mouseup += ' mouseup'; - } + mousedown = 'touchstart mousedown'; + mousemove = 'touchmove mousemove'; + mouseup = 'touchend touchcancel mouseup'; } var viewEvents = {},