-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
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
slidesvelte 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:
-
expand all nodes in the sample (i.e. all children and grandchildren)
-
collapse the top-level
USAnode -
re-expand the top-level
USAnodeNOTICE the direct
USAchildren 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?
- MERGED PR 1451: Nested transitions Nested transitions #1451
- MERGED PR 1448: add skipIntroByDefault compiler option add skipIntroByDefault compiler option #1448
- CLOSED ISSUE 117: Support for svelte compiler 'cascade' option Add charpeni/svelte-example into README tools #117
- CLOSED ISSUE 547: Skip transitions on initial render Skip transitions on initial render #547
- CLOSED ISSUE 1495: Nested components cause transitionManager to always be added if nestedTransitions: true Nested components cause transitionManager to always be added if nestedTransitions: true #1495
- CLOSED ISSUE 1492: outroing is not defined with nestedTransitions: true outroing is not defined with nestedTransitions: true #1492
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>