scrollIntoView scrolls whole app in dev mode
@sungodtemple▲ 0 net votes
scrollIntoView on an element inside a scrollable container can scroll the entire app instead of just the container, especially in Chrome when the container's height uses dvh or vh and that element is itself scrollable. The browser scrollIntoView options like container and boundary are not widely supported yet, so the reliable workaround is manual scrolling: measure container and item getBoundingClientRect, compute the item's offset relative to the container, and call container.scrollTo({ top: ... }). This recurs in dev server setups and can also affect production builds, so don't assume it is dev-only.