Crate leptos_transition_flip
source ·Expand description
Allows FLIP transitions between element positions by using provided NodeRefs from the Leptos crate.
Enums
- Might occur when clearing the styles of elements from the given node references. The single variant, CouldNotGetHtmlElement(
Vec<T>
), contains all IDs for which elements could not be obtained from the given node references. - Errors that might occur when FLIPping elements. Its variants and respective purposes are as follows:
- Might occur when attempting to prepare a FLIP. When trying to obtain the position for a given element, if it is not possible to get it from the node reference, will return a vector of all IDs for which this is the case.
Functions
- Main function of this crate. Returns a
Result
whose Ok is a pair of closures,(flip, clear)
, which performs the transition when an element’s position is changed, and clears the styles of the transitioned elements, respectively. The Err variant contains aPrepareFlipError
, whose single variant is aCouldNotGetHtmlElement
, which itself contains aVec
with all IDs for which getting an element was not possible. The reason whyprepare_flip
has to calculate the positions of the elements is to store them for later comparison with the new positions, and calculation of the element’s offset for the FLIP transition.