Bug 272079
| Summary: | [css-scroll-snap] Fragment links does not work with scroll-snap on root | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Johannes Odland <johannes.odland> |
| Component: | Scrolling | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, johannes.odland, nmouchtaris, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 17 | ||
| Hardware: | Unspecified | ||
| OS: | iOS 17 | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=255592 https://bugs.webkit.org/show_bug.cgi?id=245722 https://bugs.webkit.org/show_bug.cgi?id=251003 |
||
Johannes Odland
Anchor links on a page with scroll-snap on the root/html element fails.
Steps to reproduce:
1. Open https://johannesodland.github.io/browserbugs/2024/safari-scroll-snap-fragment-links-issue.html
2. Click on one of the anchor links
Expected result:
The linked fragment/section is scrolled into view.
Actual result:
The browser sometimes scrolls down to the relevant fragment, but snaps back to the top.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/125854281>
Ahmad Saleem
I am unable to reproduce on first load, although it is bit more involved in my case, where I have to navigate away from tab opened and then refresh tab few times to reproduce this reliably.
@Johannes - is this used to work in earlier iOS versions by any chance you know and also if you have reliable reproduction steps, it would be good to add. :-)
Johannes Odland
Thanks for testing Ahmad.
Navigating to one fragment, and then to another seems to consistently reproduce the bug for me:
1. go to section 4 ( https://johannesodland.github.io/browserbugs/2024/safari-scroll-snap-fragment-links-issue.html#section-4 )
2. Scroll to top
3. Click one of the anchor links
Johannes Odland
Retested on iOS 18.1, still failing.
Johannes Odland
Retested on iOS 26 beta, still failing.
Johannes Odland
Retested on iOS 26.2.
The issue seems partially solved.
Fragment links now works, even after scrolling.
It fails when clicking multiple fragment links after each other.
1. Click on "Section 1" – The browser scrolls to section 1
2. Scroll back to the top
3. Click on "Section 2" – The browser scrolls to section 2, but then immediately snaps back to the top of the page.