Edit this page

up.fragment up.fragment.isAlive(fragment)
JavaScript function

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.

Understanding aliveness

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

See also


Parameters

fragment
required

The fragment to check.


Return value

Whether the fragment (and its ancestors) are considered alive.

boolean