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

[BUG] MotionValues cannot be used in motion.g element's transform attribute #3082

Open
jdthorpe opened this issue Feb 23, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jdthorpe
Copy link

jdthorpe commented Feb 23, 2025

1. Read the FAQs 👇

2. Describe the bug

Unlike other SVG attributes (such as a circle's cx attribute) motion values cannot be used with a <motion.g> element's transform attribute.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

See this sandbox

4. Steps to reproduce

  1. Open the sandbox. Notice that the fill attribute applied to the <g> element is applied and propagated to the rect, but that the rect does not move.
  2. Open the console and notice that the motionValue is being updated, so that's not the problem.
  3. Right click on the rect and open the inspector. Look at the <g> element that is the parent of the <rect> element and notice that it's transform attribute is set to [object Object] instead of the value of the motionValue ("transform(50 50)").

5. Expected behavior

<motion.g> elements should be able to use motionValues for all of their attributes, including the transform attribute.

6. Video or screenshots

See the sandbox above

7. Environment details

Chrome and Edge for Mac

@jdthorpe jdthorpe added the bug Something isn't working label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant