davidkpiano / flipping

Flipping awesome animations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected behavior in the presence of nested flipping elements?

disconcision opened this issue · comments

I might be trying to do something slightly out of scope; I'm not sure if I'm exposing a gap in the implementation logic or if what I'm trying to do doesn't make sense (or I just have a bug somewhere else of course). In this example, I am using a Flipping with all-default options. I'm using solidjs, and sandwiching my signal setter with read() and update().

I'm trying to do shared element transitions with changing parent-child relations. The discrepancy in expectation arises when in the specific case when I have a parent and child element, which both flip, but in the new state, the child has a different parent. In such cases, the child either skips the transition entirely, or has an unexpected starting position.

To illustrate what I expect, here I have disabled the flip keys on the parents, so only children are flipping. Here, all children (emojis) proceed to their correct positions:
https://imgur.com/a/chlXRmv

On the other hand, when I enable the parent flip keys as well, something more complicated happens. The parent + node, and the tooth, which has the same parent in both the inital and final states, both behave as-expected. However, the mushroom transitions with unexpected initial position, and the space invader does not transition at all:
https://imgur.com/a/n7LQ1C6

Any idea as to what's happening?