fix(reader): disable tap-to-turn-page on mobile devices
This commit is contained in:
@@ -451,11 +451,13 @@ export class ReaderEventService {
|
|||||||
const leftThreshold = width * this.LEFT_ZONE_PERCENT;
|
const leftThreshold = width * this.LEFT_ZONE_PERCENT;
|
||||||
const rightThreshold = width * this.RIGHT_ZONE_PERCENT;
|
const rightThreshold = width * this.RIGHT_ZONE_PERCENT;
|
||||||
|
|
||||||
if (x < leftThreshold) {
|
const isMobile = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||||
|
|
||||||
|
if (x < leftThreshold && !isMobile) {
|
||||||
this.isNavigating = true;
|
this.isNavigating = true;
|
||||||
this.viewCallbacks?.prev();
|
this.viewCallbacks?.prev();
|
||||||
setTimeout(() => this.isNavigating = false, 300);
|
setTimeout(() => this.isNavigating = false, 300);
|
||||||
} else if (x > rightThreshold) {
|
} else if (x > rightThreshold && !isMobile) {
|
||||||
this.isNavigating = true;
|
this.isNavigating = true;
|
||||||
this.viewCallbacks?.next();
|
this.viewCallbacks?.next();
|
||||||
setTimeout(() => this.isNavigating = false, 300);
|
setTimeout(() => this.isNavigating = false, 300);
|
||||||
|
|||||||
Reference in New Issue
Block a user