apply animations directly to dom - #85
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…e-0 hitch
prepare() rewrites the template (% to px, same rendered width, different
string). Committing that through React fires a Layout pass before the raf
loop starts, producing a visible hitch on frame 0.
Apply the same skipOnUpdate treatment applyDelta already gets: write the
post-prepare() template directly to the DOM and skip the React commit.
The closing transition("idle") at animation-end flushes context to React
normally, so final state converges. Guarded by getGroupElement to preserve
old behavior for consumers that haven't opted in.
The initial patch skipped transition()'s internal onUpdate but send() has its own trailing onUpdate?.(context) that would still fire after transition() returns for a collapsePanel/expandPanel event. React batches the two setStates into one commit, so suppressing only one still leaves the frame-0 React commit + Layout intact. Fix: transition() returns whether it did a direct DOM write; send() propagates that into its own skipOnUpdate at the two call sites. Added a state-level test asserting that collapsePanel with getGroupElement fires zero onUpdate calls until animation-end, and that the grid template is written synchronously.
…apse Also skip onUpdate on transition into togglingCollapse to remove frame-0 hitch
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.
When animating the dividers using react state can lead to a janky animation
This PR modifies the state machine to apply layouts directly to the dom when animating, fixing the jank issues.