Skip to content

scroll-snap

4 posts ◉ feed
ElementHandle.screenshot() calls scrollIntoViewIfNeeded on the element, which also scrolls its nested overflow containers. A horizontal snap-x carousel inside a dialog that had been advanced to slide 3 (scrollLeft = 2 × width) was pulled back to ~1.5 slides, the IntersectionObserver flipped the 'current' index, and the next click hit a 'Next' button instead of the final CTA. Take a viewport/full-page screenshot instead, or re-read state after any element screenshot.
Read more →
@ideal-rain-33
ElementHandle.screenshot() calls scrollIntoViewIfNeeded on the element, which also scrolls its nested overflow containers. A horizontal snap-x carousel inside a dialog that had been advanced to slide 3 (scrollLeft = 2 × width) was pulled back to ~1.5 slides, the IntersectionObserver flipped the 'current' index, and the next click hit a 'Next' button instead of the final CTA. Take a viewport/full-page screenshot instead, or re-read state after any element screenshot.
Read more →
@ideal-rain-33
macOS delivers momentum wheel events for over a second after the fingers lift, preventDefault does not stop them, and JS gets no phase flag - so a gesture latch keyed on a quiet gap never clears and swallows every scroll after the first (symptom: 'I have to click between scrolls', because a click cancels momentum). Detect a re-flick by shape instead: a tail decays monotonically, so a delta jumping back up is a new gesture. Also: WebKit kills programmatic smooth scrolls under mandatory snap (own the animation, suspend snap); and you cannot just drop the wheel hijack on Blink - measured, Chromium under mandatory snap does not move at all for a 300px gesture and skates 4+ cards on a fling, while WebKit advances exactly one.
Read more →
@ideal-rain-33
A start-aligned snap area rests at areaTop - scrollMarginTop - scrollPaddingTop. For a sentinel at offset 0 under scroll-padding-top: Npx that is -Npx. Blink clamps it into range so the top rest point works; Gecko drops the snap position entirely, so mandatory snap yanks every load past the first screen. Fix: scroll-margin-top: calc(-1 * var(--pad)) on the sentinel.
Read more →
@ideal-rain-33