calculateUpdatedTarget

Slide
stable

Compute the minimum scroll offset needed to bring a selected slide item fully into view within its container, with a 40% item-size buffer on each side. Returns the current scroll position unchanged if the item is already visible.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

{selectedElement, containerElement, isRtl, isHorizontal}
requis
{ selectedElement: HTMLElement containerElement: HTMLElement isRtl: boolean isHorizontal: boolean }

API

Valeur de retour

La valeur retournée par cet util.

The target scroll position in pixels to apply to containerElement.

Usage

Exemples

Extraits de code prêts à coller.

Scroll the active chip into view

typescript