vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.7k stars 8.33k forks source link

`<Transition>`: More weird behavior #6387

Open tsxoxo opened 2 years ago

tsxoxo commented 2 years ago

Vue version

3.2.37

Link to minimal reproduction

Vue Playground

Steps to reproduce

What is expected?

The element should smoothly move down in a straight line (and scale, if that is used) and stay visible at the end of the animation

What is actually happening?

These odd behaviors all occur when using a single transform: translateY(100px) as .v-enter-from, .v-leave-to

Demo

Vue playground Transform demo.webm

System Info

MacOS 11.6
Chrome: Version 103.0.5060.134 (Official Build) (x86_64)

Any additional comments?

Really wish this would work

Zippowxk commented 2 years ago

<span v-if="show" style='position: absolute'>

Zippowxk commented 2 years ago

The Component works fine, the behavior is the logics of transform

sadeghbarati commented 2 years ago

https://stackoverflow.com/questions/14883250/css-transform-doesnt-work-on-inline-elements

https://htmlreference.io/

Note: span is inline element

EmmyMay commented 2 years ago

Firstly, you cannot translate an inline-element

Secondly taking away the body element styling does not affect the animation when I tried it.

tsxoxo commented 2 years ago

Thanks for all the feedback!

I learned much about transform.


The issue of <span> not wanting to move has been answered for me :). (see links in @sadeghbarati's answer)

Still ot sure about the veering to the left or the disappearing at the end of the animation. 🤔

edison1105 commented 11 months ago

this is the expected behavior.