Skip to content

Nested Transitions NOT Honored #4784

@KevinAst

Description

@KevinAst

I believe I have discovered an issue where Nested Transitions are not operating correctly.

Component:

I have a simple TreeView component (see code here).

  • Each node in the tree is powered through a recursion on itself (via the <svelte:self> element).

  • The expansion state of each node is retained (through a simple ModuleScoped state), so collapsing a parent does not loose the expansion of it's children (when the parent is re-expanded).

  • The expansion/contraction of each node is animated through the standard slide svelte transition

Issue:

The issue I am seeing is when you expand a node that has pre-expanded children, the animated transition only occurs at the top-level. Once the top-level transition has completed, the expanded children pop out instantly. In other words, the nested element transition is NOT honored.

To see this issue:

  1. expand all nodes in the sample (i.e. all children and grandchildren)

  2. collapse the top-level USA node

  3. re-expand the top-level USA node

    NOTICE the direct USA children correctly animate, however the grandchildren pop out instantly, once their parent transition is complete.

In contrast, if you expand/collapse the tree one level at a time, the transition animation is correct.

Am I missing something obvious in my code, or is this in fact an issue?

More Research:

I have found references to this topic in older V2 Issues/PRs, however they are all closed/merged. Is this issue thought to be fixed?

I realize that when dealing with multiple transitions, it can be difficult to generically determine the "right thing to do". This may be a case for driving some compiler directives from the component code itself ... thoughts?

Your help is greatly appreciated!

Thanks so much for such an awesome product, providing reactivity in an extremely simple form!!!

</Kevin>

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