Subscribe on changes!

Transition-group swallowing updated lifecycle hook

avatar
Jul 3rd 2021

Version

2.6.14

Reproduction link

Playground

Steps to reproduce

PART 1:

  1. Create a reactive array of items
  2. Create a v-for list with :key in a component looping over the array
  3. Have something happen in the onUpdated lifecycle. (Console.log will do)
  4. Update the array

PART 2 Wrap the the v-for in a Transition-group

What is expected?

Part 1 onUpdated lifecycle executes.

Part 2 onUpdated lifecycle executes.

What is actually happening?

Part 1 onUpdated lifecycle executes.

Part 2 onUpdated lifecycle DOES NOT execute.


If another part of the component outside of the transition-group is updated and re-rendered the Updated lifecycle executes as expected. I was just trying to add some transition to a couple of pages. Both had lazy loading images in the onUpdated lifecycle. Just wrapped my lists inside a transition-group. Everything worked fine on page A, but page B wasn't executing image loading when the list was updated even though the code was essentially the same as page A. Finally realized page A was also re-rendering something outside the transition-group allowing the onUpdated to execute for page A.