Skip to main content

scroll_into_view_if_needed

Function scroll_into_view_if_needed 

Source
pub async fn scroll_into_view_if_needed(
    adapter: &dyn EngineAdapter,
    selector: &str,
    options: &ScrollOptions,
) -> Result<ScrollResult, EngineError>
Expand description

Scroll element into view only if needed.

This function first checks if the element is already in view before performing the scroll.

§Arguments

  • adapter - The engine adapter to use
  • selector - The CSS selector for the element
  • options - Scroll options

§Returns

The result of the scroll operation