Skip to content

Prevent backdrop flash on sheet opening#237

Open
varseb wants to merge 1 commit intoTemzasse:mainfrom
varseb:fix/backdrop-initial-flicker
Open

Prevent backdrop flash on sheet opening#237
varseb wants to merge 1 commit intoTemzasse:mainfrom
varseb:fix/backdrop-initial-flicker

Conversation

@varseb
Copy link
Copy Markdown

@varseb varseb commented Mar 28, 2026

This PR fixes an intermittent backdrop flicker when opening the sheet

In some openings, the backdrop briefly renders at high opacity before animating correctly

(visual sequence like 1 -> 0 -> 0.1 -> 0.2, ...)

This happens because backdrop opacity is derived from yProgress, and y can momentarily keep a stale value during the transition to opening, before the async onOpen flow starts

The fix sets y to closedY in useIsomorphicLayoutEffect when state becomes opening
Doing this in layout phase guarantees the first painted frame starts from the closed position, preventing the flash and preserving the normal open animation

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.

1 participant