Bug 240892
Summary: | Neither preventDefault on GestureEnd nor CSS overscroll stop the Safari "Tab Expose" feature or page navigation | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jarod Gowgiel <jarod.gowgiel> |
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ap, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 15 | ||
Hardware: | Mac (Intel) | ||
OS: | macOS 12 |
Jarod Gowgiel
When zooming out on a web page, Safari triggers a "Tab Expose" view as a result of overscroll, and when scrolling backwards or forwards triggers navigation.
I'd expect that, similar to other gestures, calling preventDefault() on the resulting GestureEnd would prevent these system gestures from occurring, but that isn't the case. On iOS, it's a known workaround to preventDefault() on the touchstart event that begins the gesture, but similar workarounds (like preventDefault() on the mousedown) seem to not have the same effect on macOS in Safari from my experimentation.
As an alternate approach, I also tried out overscroll-behavior. The specification for overscroll-behavior (which will be the [new default soon](https://bugs.webkit.org/show_bug.cgi?id=236060) and that I experimented with activating for myself locally via the "Experimental Features") states that "[contain] indicates that the element must not perform non-local boundary default actions such as scroll chaining or navigation." Even when applying "overscroll-behavior: contain" to an element, both of these non-local interactions (swiping backwards, and pinching to zoom) are still triggered.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Sam Sneddon [:gsnedders]
This sounds like another issue caused by Safari being in control of this UI behaviour without really knowing what's going on with the web content.
Jarod Gowgiel
After some further experimentation, it seems like calling preventDefault() on the "wheel" event fired by Safari while panning around the trackpad does prevent page navigation, but has no impact on the "Tab Expose" gesture. "overscroll-behavior: contain" still seems to not stop either type of gesture, though.
Alexey Proskuryakov
When considering changes in this area, we need to keep in mind whether preventing standard browser behaviors is user friendly. It often isn’t.
Radar WebKit Bug Importer
<rdar://problem/94184281>
Sam Sneddon [:gsnedders]
*** This bug has been marked as a duplicate of bug 233141 ***