Skip to content

fix: extend scroll jump deferral and repaint hack to desktop Safari#862

Open
restareaByWeezy wants to merge 2 commits intoinokawa:mainfrom
restareaByWeezy:fix/desktop-safari-reverse-scroll-flickering
Open

fix: extend scroll jump deferral and repaint hack to desktop Safari#862
restareaByWeezy wants to merge 2 commits intoinokawa:mainfrom
restareaByWeezy:fix/desktop-safari-reverse-scroll-flickering

Conversation

@restareaByWeezy
Copy link
Copy Markdown

Desktop Safari has the same scrollTop update delay behavior as iOS WebKit — when scrollTop is 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 applyJump and the overflow:hidden repaint hack in the scroller only apply to iOS WebKit. This PR extends both behaviors to desktop Safari as well.

Changes:

  • Added isDesktopSafari detection in environment.ts. It checks for Apple vendor, absence of Chrome, and non-iOS platform.
  • In store.ts, applyJump now defers the jump when either isIOSWebKit() or isDesktopSafari() is true and scrolling is in progress.
  • In scroller.ts, the overflow:hidden toggle 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

restareaByWeezy and others added 2 commits March 10, 2026 00:28
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flickering on reverse scrolling when items have wide range of sizes in desktop Safari

1 participant