fix: extend scroll jump deferral and repaint hack to desktop Safari#862
Open
restareaByWeezy wants to merge 2 commits intoinokawa:mainfrom
Open
fix: extend scroll jump deferral and repaint hack to desktop Safari#862restareaByWeezy wants to merge 2 commits intoinokawa:mainfrom
restareaByWeezy wants to merge 2 commits intoinokawa:mainfrom
Conversation
…ickering (inokawa#362) Desktop Safari shares the same scrollTop update delay behavior as iOS WebKit, causing flickering when reverse-scrolling through items with varied sizes. Extend the existing iOS jump deferral to desktop Safari by adding isDesktopSafari detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Desktop Safari also delays paint when scrollTop is updated during scrolling. Apply the same overflow:hidden toggle hack used for iOS momentum scrolling to force browser repaint when flushing deferred jumps on desktop Safari. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Desktop Safari has the same scrollTop update delay behavior as iOS WebKit — when
scrollTopis updated during active scrolling, the browser delays applying the value, which causes flickering when reverse-scrolling through items with varied sizes.Currently the jump deferral in
applyJumpand theoverflow:hiddenrepaint hack in the scroller only apply to iOS WebKit. This PR extends both behaviors to desktop Safari as well.Changes:
isDesktopSafaridetection inenvironment.ts. It checks for Apple vendor, absence of Chrome, and non-iOS platform.store.ts,applyJumpnow defers the jump when eitherisIOSWebKit()orisDesktopSafari()is true and scrolling is in progress.scroller.ts, theoverflow:hiddentoggle that forces a browser repaint is applied to desktop Safari in addition to iOS momentum scrolling.Reproducing the issue: open a list of items with varying heights in desktop Safari and scroll upward quickly — without this fix, items flicker or jump noticeably.
Fixes #362