Skip to content

TransitionGroup does not take into account CSS scale #9665

Closed as not planned
@somebody1234

Description

@somebody1234

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNp9U11v0zAU/SsXS2itlCah015CNvGhCcEDINgDqM6DSW+KV8eObCfrVPW/c+20JaBpfanvOce+5x47e/a269KhR1aw0tVWdh4c+r4DJfTmmjPvOLvhWradsR72YLGBAzTWtHBB2y5ec811bbTzIKyF6yCYrfIEXiWwrOaBbXpde2k0uAfRzeaw5xpgRep0EKrHVV4lYe+xWlYVnTKhl//QeVVRywPXZTbaJXNUeGw7JTxSBVCu5QDOPyoMA1ihXWNsW4CrhcLZcg4RC/Ifs6v85aT+Ges4MdCvvAuEDOY/WEOheBEy6dVZQRolYVhQAyIk2QCpg13OoNji4xGkalh43PlzfVNmSp7aZP/1OeG/eu8ptze1kvWWtoYAaWv4e1FmIztOnNHItCqzSRBUxhBobtPhmpB0WLRmwCSuUHu0C0FXc0IUigGPyHhLMZjoqxjXIUjI0ysHKByebyK0ofNZQu+FHkMjN+m9M5oeVTyGs9q0nVRov3ThMHpTxdggcEIp8/ApYt72wcuI17+x3j6B37tdwDj7atGhHZCzM+eF3aAf6dvvnynxCdmada9I/Qz5DZ1RffA4yt71ek22J7ro9mP8HKTe3LnbnUfK6DhUMBqUh6jnjD6R98+M/tfuZXoZ91Gi7PAH6M0zDA==

Steps to reproduce

  1. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions