Bug 241461 - scroll-snap with padding-right
Summary: scroll-snap with padding-right
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 15
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://scroll-snap-center-card.glitc...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-06-09 05:42 PDT by Leon Radley
Modified: 2022-06-16 05:43 PDT (History)
5 users (show)

See Also:


Attachments
An example image of the demo (7.75 KB, image/png)
2022-06-09 05:42 PDT, Leon Radley
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>