Replies: 1 comment 4 replies
-
You need to have intermediary elements between template tags. Does this continue with that being the case? edit: verified To add some clarify, if the inner if is true, and the outer is made false, the ifs cleanup, but not the template. The x-data between the two x-ifs also does not matter |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Elements that are
x-teleport
-ed but also nested inside anx-if
should get removed from the DOM, once the condition for thex-if
becomes falsy. If the following conditions are met however they remain in the DOM:x-teleport
is nested inside exactly twox-if
sx-if
the inner(edit: @ekwoka clarified that this doesn't matter)x-if
depends on values that are defined inside the outerx-if
Minimal example:
This leads to the teleported element being duplicated every time
x-if
becomes truthy again.I've reproduced the issue here: https://codepen.io/mgschoen/pen/zYVOZbm
Beta Was this translation helpful? Give feedback.
All reactions