Comments (10)
@mattgperry Can confirm, this is still a bug. I want to rotate
an SVG on hover
to 0deg
from initial
position -6deg
so I wrote it like this:
<motion.svg
initial={{
rotate: -6,
}}
whileHover={{
rotate: 0,
}}
>
{/*...*/}
</motion.svg>
But it automatically adds transform-origin: 87.936px 88.936px;
to the browser when I didn't even specify anything.
I think it should be just 0px 0px
if nothing is provided.
from motion.
Setting
I had the same issue. Setting this, worked for me:
style={{originX: 0.5, originY: 0.5}}
This didn't work for me but it led me to
style={{ originX: '50%', originY: '50%' }}
which did!!
from motion.
I'm having the same issue. Please fix this bug.
from motion.
I had the same issue. Setting this, worked for me:
style={{originX: 0.5, originY: 0.5}}
from motion.
Ah I just realised setting originX
to "0px"
, not 0
, is what I want.
As it mentions in the documentation:
If set as numbers, originX and Y default to a progress value between 0 and 1.
A progress value of what though? The bounds of the object?
from motion.
This bug is in build 1.10.3
.
I tried rotating a circle svg element to simulate the movement of the sun. Setting the transformOrigin of the circle gets overridden. Here is a codesandbox showing an example.
Here is what the css shows when I inspect the element in chrome.
Here's what I tried:
- adding
"transform-origin": "center"
to the hidden and visible properties of the variant object (transformOrigin throws and error). - wrapping the circle element in a
motion.g
element and adding the transform origin style there.
from motion.
Setting
I had the same issue. Setting this, worked for me:
style={{originX: 0.5, originY: 0.5}}
This didn't work for me but it led me to
style={{ originX: '50%', originY: '50%' }}
which did!!
Nevermind... 50% here sets the origin relative to the svg tag, while using a number evidently sets the origin relative to the path itself. It working earlier was just a fluke
from motion.
Fixed in 1.6.4
from motion.
Hi, I'm still having this issue when transforming motion.g
elements. Even if I set my own transform origin it seems to set its own based on the bounding box of its children.
See here: https://codesandbox.io/s/determined-monad-rcidp
Expected: transform-origin
to be set to originX originY
It doesn't show in the codesandbox, but I've noticed it also tries to set the transform-origin as transformOrigin
which react doesn't recogniee.
from motion.
The bug persists exclusively on Firefox. It consistently sets the value transform-origin: 0px 0px 0px
, and only applying style={{ originX: '50%', originY: '50%' }}
or transform-origin: 50% 50% !important
helps to achieve the desired result. Notably, the functionality works correctly on Chrome.
<motion.circle
cx="50"
cy="45"
r="10"
fill="black"
animate={{
y: active ? 5 : 0,
scale: active ? 3 : 1,
}}
/>
from motion.
Related Issues (20)
- useScroll exhibits jumping on page load (Nextjs) HOT 1
- [BUG] `transform` animation snaps immediately to end when interrupted, since `v11.0.11` HOT 3
- [BUG] Unable to animate svg text elements
- [FEATURE] Re-register use in view hook on component re-render
- [BUG] Type bug with SVGTransformAttributes in AnimationSequence
- [BUG] Animation lag after updating from v10x to 11x HOT 7
- [BUG] Systematic error keyframes when updating framer @11.0.17 HOT 2
- [FEATURE] Support for `className` and `id` HOT 2
- [BUG] `transform` spring animations not interruptible since `v11.0.11`
- [BUG] `Maximum call stack size exceeded` error when using `delay` and `ease` function HOT 1
- [BUG] Error Only two keyframes currently supported with spring and inertia animations. HOT 1
- [BUG] `whileHover` state does not reset when element transitions to `dragConstraints`
- [BUG] framer-motion is incompatible with TypeScript v5.4 HOT 1
- [FEATURE] Please allow reducedMotion from <MotionConfig> to be used in animate()
- [BUG] It isn't possible to animate the `x` and `y` coordinates of an SVG element using `animate` HOT 1
- [BUG] Framer Motion Animation doesn't work on reload without delay HOT 6
- [BUG] LazyMotion sets `initial` immediately; before `LazyMotion.features` load
- [BUG] with new version 11.0.24 HOT 3
- [FEATURE] Expose moved item index in Reorder.group
- ref prop does not work on div directly inside AnimatePresence with mode="popLayout" [BUG] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motion.