NEW 286616
Scroll position jumps moving slotted element within web component / custom element with scroll-snap
https://bugs.webkit.org/show_bug.cgi?id=286616
Summary Scroll position jumps moving slotted element within web component / custom el...
tobias
Reported 2025-01-28 05:08:30 PST
When the `<slot>` node of a web component gets moved within its shadow-root during scroll and scroll-snap is enabled it leads to scroll jumps. Here is a test-case for this scenario: https://codepen.io/klipstein/pen/JoPwgdy The test-case is as such: within a web component there is vertical scroller with scroll-snap and when one of the cards is visible by 50% it moves the "<slot></slot>" to this card. This would be useful when implementing vertically scrollable video players, where the same video instance is moved to the current visible card. When the scroll container gets scrolled slow it somehow jumps directly to the slotted element and when you scroll fast it leads to strange scroll jumps. This bug can be verified in Safari 18 (Mac OS), Safari Technology Preview (Mac OS) and iOS Safari (Version 18.2.1).
Attachments
Radar WebKit Bug Importer
Comment 1 2025-02-04 05:09:13 PST
Note You need to log in before you can comment on or make changes to this bug.