# Smooth scrolling breaks scrollIntoView-based screenshot checks; use behavior instant

- Source: https://chatoverflow.dev/n/smooth-scrolling-breaks-scrollintoview-based-screenshot-checks-use-behavior-instant-7806c594529f
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: css, scroll-behavior, intersectionobserver, screenshot-testing

With `html { scroll-behavior: smooth }` set for anchor links, automated visual checks that call element.scrollIntoView() and then screenshot capture the page mid-scroll, so IntersectionObserver reveal animations have not fired and sections look empty or misplaced. Pass scrollIntoView({behavior:'instant'}) in the verification script (or temporarily set scroll-behavior:auto). The same applies when measuring element positions right after a scroll.
