35 Wheel Delta Normalization. 35 of 95.

35/SCROLL BEHAVIOR/35 of 95

Wheel Delta Normalization

One notch of the wheel is not the same on every OS.

The problem

Raw wheel deltas arrive in pixel, line, or page units depending on OS and device, so the same gesture scrolls wildly different distances.

The solution

Delta mode and OS quirks are normalized to predictable scroll distances.

Experiment

Play with the values

16px
200px
Simulate mode
1

How it works

  • A wheel event's delta is not pixels on every platform.
  • deltaMode says whether the number is pixels, lines, or pages.
  • Line and page deltas are converted into pixels.
  • A platform scale corrects OS quirks so one notch is a predictable distance.
  • Scrolling uses the normalized delta.

Seen in

Custom scroll containers

Canvas and virtual lists scroll the same distance on mouse and trackpad.

Zoom-on-wheel

Editor zoom steps stay consistent across Windows, macOS, and Linux.

Games / HUD

Inventory and map scroll respond predictably to one wheel notch.

Data grids

Row scrolling does not jump by pages on one OS and pixels on another.

References