[Webkit-unassigned] [Bug 272799] New: scroll-padding causes unwanted scroll on sticky elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 16 20:21:25 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=272799

            Bug ID: 272799
           Summary: scroll-padding causes unwanted scroll on sticky
                    elements
           Product: WebKit
           Version: Safari 17
          Hardware: All
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Scrolling
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mic.gallego at gmail.com
                CC: simon.fraser at apple.com

Created attachment 470952

  --> https://bugs.webkit.org/attachment.cgi?id=470952&action=review

Scrolling bug

Hi,

A common way to have the anchor scroll works well with sticky element is to add a scroll-padding-top on the HTML to account for the sticky elements. Unfortunately, on Safari and Chrome (Firefox works as expected), this cause an unwanted scroll when using a sticky element.

To reproduce the issue:

1. Open the pen: https://codepen.io/bakura10/pen/QWPVYEE
2. Scroll lower into the page.
3. Focus one of the link in the sticky bar, and you will see that the page will scroll up automatically. This only happens for sticky element. If the positioning is changed to fixed, it works as expected.

Please see the attached video for more details. I am cross-posting this issue on Chrome bug-tracker as well.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240417/3502cdd8/attachment.htm>


More information about the webkit-unassigned mailing list