| Summary: | CSS overscroll-behavior-x: contain does not disable history navigation | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Šime Vidas <sime.vidas> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | agafvv, augus.dupin, bramus, dan, dev, gsnedders, holmesmatt907, jensimmons, jond, me, nmouchtaris, rik, simon.fraser, webkit-bug-importer, zachleatherman |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=235851 | ||
|
Description
Šime Vidas
2022-05-06 14:06:25 PDT
Per the specification, such browser action should indeed be prevented when setting `overscroll-behavior-x` to either `contain` or `none`: > 'contain': This value indicates that the element must not perform non-local boundary default actions such as scroll chaining or *navigation*. From https://drafts.csswg.org/css-overscroll/#overscroll-behavior-properties. This is important for most horizontal scroll-containers, as it is very easy to accidentally trigger history navigation while scrolling, causing very poor user experiences. This is one of the top reasons this specification was introduced and eagerly expected by developers. Safari not respecting this also causes interoperability issues with Firefox and Chrome. As previous comments mention, preventing navigation on horizontal swipes is a big part of the rationale for this CSS feature, and an aspect on which developers eagerly expected Safari to align with other browsers. Please re-consider the decision to allow history navigation despite overscroll-behavior. This behavior prevents any website from utilizing horizontal scrolling without hacky `event.preventDefault()` `wheel` listeners. (Hacky because it seems they need to be set on the element under the cursor, rather than a common parent like `document.body`.) As the previous commenters have said, please reconsider this, if it was indeed done intentionally. Firefox has this implemented corretly according to spec |