This feature is experimental. Please share your experiences so we know what to keep or change.
Returns whether the given fragment is both attached to the DOM and not currently in a destroy animation.
A fragment that is alive can be targeted, and can be discovered by up.fragment
functions.
An fragment becomes "unalive" immediately when it is destroyed, or when an ancestor is destroyed. If the destruction is animated, the fragment is "unalive" while the animation is still playing.
Element state | up.fragment.isAlive(element) |
---|---|
Entered DOM | true |
Enter animation playing | true |
Still element in the DOM | true |
Exit animation playing | false |
Removed from DOM | false |
.up-destroying
class is automatically assigned to elements in their exit animation.up.fragment
functions (like up.fragment.get()
) ignore elements in their exit animation.up.Layer#isAlive()
method checks if an overlay is is attached to the DOM and also not in a closing animation.Whether the fragment (and its ancestors) are considered alive.