-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
CSS zoom on grid breaks flip #13093
Comments
Hey, I would like to work on this :) |
The reason this happens is because of the difference between scaled length and unscaled lengths. |
Thank you so much for your work on this! I tried using your updated However, one detail that exists in my project (that I left out of the REPL for simplicity) is my grid items also have Is this something that can be fixed along side your change? I'm also happy to cut a new issue if they're unrelated. Let me know if you need any more detail, and thanks again! |
Thank you for the bug 😉 I will check to see if they are related - perhaps it is a wide-spread problem among transitions/animations. Zoom is a newer feature if I am not mistaken and perhaps until now it was not accounted for. I will update here so you can open a new issue if needed. |
I entered the new (and old!) REPLs on my phone, and I didn't see any problem (DuckDuckGo's browser & Chrome). When I came back home, the problems did show on desktop. |
Describe the bug
Setting the CSS zoom property to a number other than
1
on a grid container with children withanimate:flip
causes the flip animations to originate from incorrect positions.While I'm personally unfamiliar with Svelte's source code, I'd imagine this is a bug with the flip animation's origin position calculation not accounting for the zoom.
Please let me know if you need any more detail. Additionally, if you can point me to where this calculation is done in the code, I can take a shot at implementing a fix. Thank you!
Reproduction
REPL: https://svelte.dev/repl/8da44c207d3741e296054ff787111f3a?version=4.2.19
In this example, you can add and remove fruit randomly from a 3x3 grid. Try clicking the "Add" and "Remove" buttons and you'll find that the fruit is animated correctly. However, now try checking the "Zoom" checkbox, which applies the CSS property
zoom: 2
to the grid. After doing so, you'll find that adding and removing fruit is no longer animated correctly. Specifically, the origins of the animations are calculated incorrectly.Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: