Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

[Bug] Scroll breaks when using it on a svg or svg path #204

Open
tsharms opened this issue Jul 12, 2023 · 2 comments
Open

[Bug] Scroll breaks when using it on a svg or svg path #204

tsharms opened this issue Jul 12, 2023 · 2 comments
Labels
Bug Bug report

Comments

@tsharms
Copy link

tsharms commented Jul 12, 2023

Bug description:

I would like to add an animation to an SVG based on scroll using Motion One. As an example, I have created a very simple SVG that rotates on scroll. When I apply the animation to the parent div, it works without any issues. However, when I move the animation class to the SVG (path or SVG element, it doesn't matter), my browser window completely freezes and becomes unresponsive. I have tested this in Safari, Firefox, and Chrome, and all three browsers exhibit the same behavior.

If I remove the scroll function around the animation, the animation starts working again.

Example Codesandbox links:

I have created three sandbox links, and the only difference between them is the element being animated.

Working example
https://codesandbox.io/s/motion-scroll-working-example-gcx84c

Working example but only animates without scroll
https://codesandbox.io/s/motion-working-example-kxcjwc?file=/src/index.js

Breaking example (open with caution because browser window will break)
https://codesandbox.io/s/motion-scroll-breaking-example-t5jq2c?file=/index.html

@tsharms tsharms added the Bug Bug report label Jul 12, 2023
@arnojong
Copy link

Has anyone looked into this yet? I have the same issue.

@liamlyness97
Copy link

Was this fixed or did you find an fix for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants