Transition Component does not end transition on from-to-class when setting class properties
Vue version
3.2.45
Link to minimal reproduction
Steps to reproduce
on load transition does not end on from-to-class
What is expected?
transition stops mid screen
What is actually happening?
to class removed on transition end
System Info
using SFC playground
chrome macos
Any additional comments?
No response
please refer to https://vuejs.org/guide/built-ins/transition.html#css-based-transitions modify minimal reproduction: https://sfc.vuejs.org/#eNp9Ustu2zAQ/BWCQJEWiEQ1bS6qEqT/0CMvtLSKmfIFcqXEMPzvWZK24yRAbpyZ3RkuuXv+N4R2XYD3fEhj1AFZAlzCvXTaBh+R7VmEmR3YHL1lV1R6JZ10o3eJSrf+md3lgu8YF/gh3SCqC/UTQLDBKARCjA3/wECxRH8n+cZPO8mLkrWoXNKovWMqBFCRgUOITU5tRqNSopYMJD8qakS9wlmr8GxIlpNe2dromcR8OWo81Y7eWu+IuN+CMX4QVHq6iHi7SaWIOd6b8CAuRiKYcGfysa2WbJ9bgq/9PZv1C0x/Mmdgxp515Rz14/YMJp3Ib0e1Bl4K87Qk1POuoSdGGrVnYxm4aBuP6G3PbrtvhA8UXL6lxJ605md3Ukmv71Ir8Dxaz5QxxfGNa6YlqiredF1nU/WgHy1D8mteN6KxKrRPyTvamWIrj0KSvK9BmaNNyVjyLWJIvRCLC/8f80OJB9JEXBxqC83k7cOv9qb9fUvfkPCSbyHZZhP9c4JIiZJfX5gLIlfagwhuggjxy7APte8CP2ifQnMmvcOBH14BE2gZKg==
i still dont think its working. It only happens to work due to the css ordering. Actually both classes are applied. if i take your example and move the .from class above the .common class it doesnt work again. Thats important because you might not have control over the ordering of css eg tailwind
enter-to-class is not applied continuously, only for a tick at the end. the proposed solution is correct. If you have CSS order issues, make the from class of higher specificity. And yes, with tailwind that means you would have to create a class with @apply
in this specific case. In others, whe the transitioned value is inherited/default (i.e. opacity: 1
, you would not have to do that.
Okay. Thanks for your explanation. Feels like it needs one more css class for after like from-class, from-to-class, "from-to-after". Im not sure the point of from-to-class removing on transition end but yeah relying on css specificity for Transition component is not ideal.
The actual use case is a slide up menu from the bottom of the screen in mobile view