Skip to content

Svelte 5: style:transform not updating when transition:fly is present on same element #11156

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

Closed
lumosminima opened this issue Apr 13, 2024 · 1 comment · Fixed by #11216
Closed
Assignees
Milestone

Comments

@lumosminima
Copy link

Describe the bug

In Svelte 4, I was able to use both style:transform="translateX({state}px)" and transition:fly on the same element for implementing a draggable sheet/drawer. Transitions were used for when drawer is first opened and translate for moving using on:mousemove. But in Svelte 5 it seems like transition:fly overwrites? the translate that is present on style directive. I'm able to get the original functionality in svelte 5 by wrapping the drawer with another div which now has the transition:fly on it so they don't conflict. I'm not sure weather I was using these wrong or which behavior is correct.

Reproduction

I'm using binded range input to demonstrate the translate behavior:

Svelte 4: https://svelte.dev/repl/e8e45423d69a409f92860c689b121e6b?version=4.2.14
Svelte 5: transition:fly and translate on same element behaviour REPL

  • Click on Toggle Drawer
  • Now drag the slider
  • See transform: translate updates in Svelte 4 but not Svelte 5

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
    Memory: 11.90 GB / 15.49 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 21.5.0 - ~/.local/share/pnpm/node
    npm: 10.2.4 - ~/.local/share/pnpm/npm
    pnpm: 8.15.5 - ~/.local/share/pnpm/pnpm

Severity

annoyance

@lumosminima lumosminima changed the title Svelte 5: style:transform not updating when transition:fly is present on same element Svelte 5: style:transform not updating when transition:fly is present on same element Apr 13, 2024
@Xerios
Copy link

Xerios commented Apr 14, 2024

This issue is related to #11165

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 a pull request may close this issue.

4 participants