Something went wrong. Try again.
leaflet fork for copy edit / bug fixes forked from leaflet.pub/leaflet
Something went wrong. Try again.
1234567891011121314import { scrollIntoViewIfNeeded } from "./scrollIntoViewIfNeeded";
export function scrollIntoView(elementId: string, threshold: number = 0.9) { const element = document.getElementById(elementId); // Use double requestAnimationFrame to ensure the element is fully painted // before attempting to scroll. This fixes smooth scrolling when opening // pages from within other pages. requestAnimationFrame(() => { requestAnimationFrame(() => { scrollIntoViewIfNeeded(element, false, "smooth", threshold); }); });}