scroll event
The event fired when a page or element scrolls; scrolling of an element does not bubble to the document.
In more detail
Scroll events fire many times per second, so handlers must be cheap. Listen on the element that scrolls, or use capture on the document.
Related terms
- passive event listener — An event listener registered with { passive: true }, which promises never to call preventDefault, so the browser can scroll immediately without waiting for it.
- jank — Visible stutter or freezing in scrolling or animation, caused when the browser misses frames because work took too long.
- list virtualization — Rendering only the rows of a long list that are currently visible, plus a few extra, instead of creating DOM nodes for every item.
- viewport — The visible area of a web page in the browser window or device screen.
Taught in
- Event Delegation: Memory-Efficient Interaction Handlers — Frontend Architecture & Web Platform
- Passive Listeners, Scroll Performance And Touch Interactions — Frontend Architecture & Web Platform
- useLayoutEffect vs useEffect: Painting And Synchronous Reads — React 19 & Modern Component Architecture
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture
- Virtualization: Rendering Infinite Datasets Efficiently — React 19 & Modern Component Architecture