Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation rects need to be measured before any other updates #4732

Open
Rich-Harris opened this issue Apr 27, 2020 · 1 comment
Open

Animation rects need to be measured before any other updates #4732

Rich-Harris opened this issue Apr 27, 2020 · 1 comment

Comments

@Rich-Harris
Copy link
Member

Describe the bug
When using the animate: directive, DOM nodes are measured immediately before updates are applied to them. But if an update to a parent element already happened, this can result in them being in the wrong place at the time of being measured.

To Reproduce
https://svelte.dev/repl/8c4d61bba033437bb9add90f5355df25?version=3.21.0 (via https://stackoverflow.com/questions/61430023/svelte-out-transition-in-flip-animation-in-grid-layout-flies-off-from-top-left)

Expected behavior
Toggling the column should cause 3, 6 and 9 to smoothly move to their new location. To achieve this, I think we'd need to measure DOM nodes before any DOM updates happened at all, which sounds tricky to do.

Severity
Medium. It's a bad bug, but a fairly niche situation.

@Conduitry
Copy link
Member

This seems sort of adjacent to #4111/#4344 but it might not actually be related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants