Re: [w3c/manifest] Add option to disable built-in navigation gestures (Issue #1041)

cepm-nate left a comment (w3c/manifest#1041)

To anyone looking for a solution, here is what we implemented for a Framework7 Vue PWA app, within the main app mounted() function:

```
// Disable the 'swipe to back' gesture on iOS
    const firstDiv = document.querySelector('div');
    if (firstDiv) {
      firstDiv.addEventListener('touchstart', (e) => {
        let x = e.pageX;
        // If pageX does not exist, try touches[0].pageX
        if (!x) x = e.touches[0].pageX;
        // is not near edge of view, exit
        if (x > 20 && x < window.innerWidth - 20) return;
        // prevent swipe to navigate back gesture
        e.preventDefault();
      });
    }
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/1041#issuecomment-2880637901
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/manifest/issues/1041/2880637901@github.com>

Received on Wednesday, 14 May 2025 15:19:17 UTC