1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Fix swipe right to exit zapper/picker on touch displays

Regression from:
- d23f9c6a8b
This commit is contained in:
Raymond Hill 2020-09-12 11:29:39 -04:00
parent 218f774ba0
commit 05893a6c16
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -301,7 +301,6 @@ const onSvgTouch = (( ) => {
return; return;
} }
if ( startX === undefined ) { return; } if ( startX === undefined ) { return; }
if ( ev.cancelable === false ) { return; }
const stopX = ev.changedTouches[0].screenX; const stopX = ev.changedTouches[0].screenX;
const stopY = ev.changedTouches[0].screenY; const stopY = ev.changedTouches[0].screenY;
const angle = Math.abs(Math.atan2(stopY - startY, stopX - startX)); const angle = Math.abs(Math.atan2(stopY - startY, stopX - startX));
@ -329,7 +328,9 @@ const onSvgTouch = (( ) => {
if ( swipeRight === false && angle < Math.PI - angleUpperBound ) { if ( swipeRight === false && angle < Math.PI - angleUpperBound ) {
return; return;
} }
if ( ev.cancelable ) {
ev.preventDefault(); ev.preventDefault();
}
// Swipe left. // Swipe left.
if ( swipeRight === false ) { if ( swipeRight === false ) {
if ( pickerRoot.classList.contains('paused') ) { if ( pickerRoot.classList.contains('paused') ) {