Conditional rendering causing to trigger CSS transition
Version
3.2.26
Reproduction link
Steps to reproduce
Change page using pagination button (not prev/next)
What is expected?
Switch should not animate when is mounted
What is actually happening?
For some reason, the switch is animated when is mounted. IDK why because its value is always set to true. This bug is related to the fact that inside the pagination I conditionally render either a button or a span tag. (line 38). If you set ENABLE_SPAN_SWAP
to false to disable conditional rendering or use prev/next buttons to change the page then this bug disappears. Also, I couldn't reproduce it in the latest Firefox version, only in the latest Chrome/Chrome Canary.
More info, this is related to the v-model directive. If I replace v-model
with :checked
attribute in Switch.vue then it's fine
Caused by these lines:
I think that code should work as well if it was in a beforeMount
, need to try later. if so, should solve the bug.
Edit: Similar issue likely here:
Unfortunately it seems not to be as simple as that ... We will need to look deeper into other remedies