What is the issue with the HTML Standard?
🚫 Feature Request: Expose Cancellable Event or API to Disable Browser Swipe Navigation Gestures
📌 Summary
Modern browsers implement native swipe gestures (horizontal and vertical) for navigation (e.g., back/forward, overscroll). However, these gestures are not exposed to web applications and cannot be intercepted using event.preventDefault().
This creates a limitation for advanced web applications that rely on custom gesture handling.
❗ Problem Statement
Currently:
- Browser-level swipe gestures (trackpad/mobile) trigger navigation
- No DOM event is fired for these gestures
event.preventDefault() cannot stop navigation
- CSS like
overscroll-behavior is insufficient or inconsistent
As a result, developers cannot:
- Detect swipe navigation gestures
- Override default browser behavior
- Implement custom gesture-driven UX reliably
🎯 Expected Behavior
Web applications should be able to:
- Detect swipe navigation gestures
- Prevent default navigation when required
- Implement custom gesture handling
🔍 Current Behavior
- Horizontal swipe → triggers back/forward navigation
- Vertical overscroll → triggers browser-level actions
- No standard event is emitted
- No reliable opt-out mechanism exists
💥 Impact
This limitation affects:
- Full-screen web apps (e.g., editors, dashboards)
- PWAs and mobile-first applications
- Canvas/WebGL-based apps
- Gesture-heavy UI/UX systems
Issues observed:
- Unexpected navigation → loss of application state
- Conflicts with custom gesture libraries
- Inability to achieve native-like UX
🔁 Steps to Reproduce
- Create a web app with custom gesture handling
- Add touch/pointer event listeners with
preventDefault()
- Perform horizontal swipe (trackpad or mobile)
- Observe browser navigates back/forward instead of respecting app logic
🧪 Workarounds Attempted
overscroll-behavior: none
- Touch and pointer event interception
- Passive event overrides
❌ None reliably prevent browser navigation gestures across environments
💡 Proposed Solutions
Option 1: New Cancellable Event
window.addEventListener("browserswipe", (event) => {
if (event.direction === "left" || event.direction === "right") {
event.preventDefault(); // Prevent navigation
}
});
What is the issue with the HTML Standard?
🚫 Feature Request: Expose Cancellable Event or API to Disable Browser Swipe Navigation Gestures
📌 Summary
Modern browsers implement native swipe gestures (horizontal and vertical) for navigation (e.g., back/forward, overscroll). However, these gestures are not exposed to web applications and cannot be intercepted using
event.preventDefault().This creates a limitation for advanced web applications that rely on custom gesture handling.
❗ Problem Statement
Currently:
event.preventDefault()cannot stop navigationoverscroll-behavioris insufficient or inconsistentAs a result, developers cannot:
🎯 Expected Behavior
Web applications should be able to:
🔍 Current Behavior
💥 Impact
This limitation affects:
Issues observed:
🔁 Steps to Reproduce
preventDefault()🧪 Workarounds Attempted
overscroll-behavior: none❌ None reliably prevent browser navigation gestures across environments
💡 Proposed Solutions
Option 1: New Cancellable Event