Skip to content

VBC-112: scroll-hijacking ​

warning

Category: ux-dx
Analysis: Regex (line by line)
File types: .js, .ts, .tsx, .css, .astro
Scope: source code only, ignoring anything inside strings and comments
Tags: ux

What it reports ​

Potential scroll hijacking or forced smooth scrolling detected at line {line}.

Flagged ​

js
window.addEventListener('wheel', onWheel);
js
html { scroll-behavior: smooth; }

Not flagged ​

js
window.addEventListener('scroll', onScroll);

Pattern ​

regex
window\.addEventListener\(['"]wheel['"]|\bscroll-behavior:\s*smooth

Released under the MIT License.