Bug 241461

Summary: scroll-snap with padding-right
Product: WebKit Reporter: Leon Radley <leon>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, leon, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: All   
OS: All   
URL: https://scroll-snap-center-card.glitch.me/
See Also: https://bugs.webkit.org/show_bug.cgi?id=236142
Attachments:
Description Flags
An example image of the demo none

Description Leon Radley 2022-06-09 05:42:24 PDT
Created attachment 460129 [details]
An example image of the demo

I wanted to build a card side scroll where only one card is visible at a time.

I wanted the active card to always be centered, so I added some padding to the scroll snap container to force the first and last cards to get centered.

This works in chrome.

In safari (tested in both mac, ios, ipad)
the padding-right is ignored, so the last card does not get centered.
but the padding-left works and the first card gets centered.

could it be that the padding-right is not getting included when the container is set to be a scroll snap container?


Here you can find a demo showcasing the bug

https://scroll-snap-center-card.glitch.me/
Comment 1 Radar WebKit Bug Importer 2022-06-16 05:43:12 PDT
<rdar://problem/95290382>