From 05893a6c16a6e7e374468bfb6844b2dd80499ab9 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 12 Sep 2020 11:29:39 -0400 Subject: [PATCH] Fix swipe right to exit zapper/picker on touch displays Regression from: - https://github.com/gorhill/uBlock/commit/d23f9c6a8b620ae0c61aab7fba7477471bd656fb --- src/js/epicker-ui.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/epicker-ui.js b/src/js/epicker-ui.js index d062574c0..fc628e122 100644 --- a/src/js/epicker-ui.js +++ b/src/js/epicker-ui.js @@ -301,7 +301,6 @@ const onSvgTouch = (( ) => { return; } if ( startX === undefined ) { return; } - if ( ev.cancelable === false ) { return; } const stopX = ev.changedTouches[0].screenX; const stopY = ev.changedTouches[0].screenY; const angle = Math.abs(Math.atan2(stopY - startY, stopX - startX)); @@ -329,7 +328,9 @@ const onSvgTouch = (( ) => { if ( swipeRight === false && angle < Math.PI - angleUpperBound ) { return; } - ev.preventDefault(); + if ( ev.cancelable ) { + ev.preventDefault(); + } // Swipe left. if ( swipeRight === false ) { if ( pickerRoot.classList.contains('paused') ) {