`TransitionGroup` does not take into account CSS scale
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
- Click the button
What is expected?
No jumps in the transition animation
What is actually happening?
Jump at the very start, because CSS scale is not being taken into account, so the distances are off by a factor of
System Info
No response
Any additional comments?
See also #6387.
Should probably be tested with and without scale()
on the child elements too.
This SO post indicates that element.getBoundingClientRect().width / element.offsetWidth
should be enough to figure out the scale:
https://stackoverflow.com/questions/5603615/how-to-get-the-scale-value-of-an-html-element-using-javascript-or-jquery
However, getBoundingClientRect
may be expensive - although it should only need to be called when the transitions start, but if it is too expensive then a way to opt-in would be fine too
It seems like TransitionGroup
is already doing getBoundingClientRect()
:
https://github.com/vuejs/core/blob/1c525f75a3d17a6356d5f66765623c0ae7c0ebcc/packages/runtime-dom/src/components/TransitionGroup.ts#L175-L177
So there should be no problem with the / element.offsetWidth
approach, at least