Const
Scrolls the viewport to bring the selected element into view.
Uses the browser's scrollIntoView API with configurable behavior.
scrollIntoView
Operation data with scroll properties erased
// Smooth scroll to element at top of viewportconst result = scrollToElement({ selectedElement: $targetElement, behavior: 'smooth', block: 'start'}); Copy
// Smooth scroll to element at top of viewportconst result = scrollToElement({ selectedElement: $targetElement, behavior: 'smooth', block: 'start'});
// Center element in viewportconst result = scrollToElement({ selectedElement: $targetElement, behavior: 'smooth', block: 'center'}); Copy
// Center element in viewportconst result = scrollToElement({ selectedElement: $targetElement, behavior: 'smooth', block: 'center'});
Scrolls the viewport to bring the selected element into view.
Uses the browser's
scrollIntoViewAPI with configurable behavior.