Skip to content

Svelte 5: Crossfade animation timing #13802

@jessecoleman

Description

@jessecoleman

Describe the bug

This seems to be a regression in svelte 5, when adding a crossfade send/receive to an array of elements, and then staggering their delay, the transitions don't start at exactly the specified time. This is more pronounced on slower devices, and in extreme cases there's an additional issue where the first frame of the CSS animation flashes at the very end again.

First example (Google Pixel 5, chrome):
https://github.com/user-attachments/assets/66e41221-fa65-4c05-9b9a-1f1c23b94b0e

if you pause it mid-transition, the blocks should all be lined up diagonally, but instead they are slightly offset. (I'm using linear easing here to make the issue clear)
image

Second example (iPhone 6s, safari):
https://github.com/user-attachments/assets/6f0df79d-5945-4dc6-a3c0-14b74e996d4a

In this case the issue is very apparent, and this is the more critical issue blocking my migration. I can live with slight timing issues.

Reproduction

https://github.com/jessecoleman/svelte-5-flip/tree/crossfade

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (22) x64 Intel(R) Core(TM) Ultra 7 155H
    Memory: 9.11 GB / 15.31 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    pnpm: 8.15.5 - ~/.local/share/pnpm/pnpm

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions