Home > widget-integration > InstantSearchController > awaitAnimationElementFinished
InstantSearchController.awaitAnimationElementFinished() method
Wait for an element's CSS animation to finish by polling its position.
Polls the element's getBoundingClientRect() at intervals. Once the x/y coordinates stabilize between two consecutive polls (and are >= 0), the animation is considered finished.
**Legacy**: awaitAnimationElementFinished(htmlElement, step, maxMs) **New**: Instance method with same signature and behavior
Signature:
protected awaitAnimationElementFinished(element: HTMLElement, step?: number, maxMs?: number): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
element |
HTMLElement |
The element to watch |
|
step |
number |
(Optional) Polling interval in ms (default 100) |
|
maxMs |
number |
(Optional) Maximum wait time in ms (default 1000) |
Returns:
Promise<void>