Setting IsSwipeNavigationEnabled = false does not disable swipe navigation
robpain-accesso opened this issue · comments
What happened?
During initialisation of WebView2 our code sets the following properties:
IsSwipeNavigationEnabled = false;
IsPinchZoomEnabled = false;
We did this in May 2023 to prevent swipe gestures navigating forward/back and worked perfectly when we were using version 1.0.1661.34 of the WebView2 package. But we upgraded to version 1.0.2151.40 in December and now it is possible to use a swipe gesture to trigger forward/back navigation (we can see the circle with an arrow dragged in from the left/right edge of the screen when this happens).
I have also recreated the issue after upgrading the WebView2 package to 1.0.2478.35 (with Edge 124.0.2478.51 installed).
Based on other issues here I also tried adding the following code, which made no difference to the behaviour:
var options = new CoreWebView2EnvironmentOptions("--disable-features=ElasticOverscroll,msEdgeMouseGestureSupported,msEdgeMouseGestureDefaultEnabled --enable-features=kEdgeMouseGestureDisabledInCN");
var env = await CoreWebView2Environment.CreateAsync(null, null, options);
I have also tried downgrading the WebView2 package back to 1.0.1661.34, whilst retaining the latest Edge, and can recreate the problem then too, so to me at least it appears the runtime may have regressed this issue?
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
124.0.2478.51
SDK Version
1.0.2478.35
Framework
Winforms
Operating System
Windows 11
OS Version
10.0.22631
Repro steps
Reported by our testing team using a touchscreen to swipe left/right, but also possible to recreate using a laptop touchpad with a standard two finger horizontal swipe gesture.
Repros in Edge Browser
Yes, issue can be reproduced in the corresponding Edge version
Regression
Regression in newer Runtime
Last working version (if regression)
113.0.1774.57
Thank you for reporting the issue. I have created work item for somebody to take a look.
After some experimenting it seems the horizontal swipe gesture can be switched off using the following:
--disable-features=ElasticOverscroll,OverscrollHistoryNavigation
In case it helps, we only had a problem with horizontal swipe, not vertical.
From a quick scan of the chromium source it looks like OverscrollHistoryNavigation was added around August 2023, so maybe that somehow affected the behaviour of IsSwipeNavigationEnabled?