Diagram comparing locked vs unlocked scroll gesture paths
A cartoon skull with a hotpink hat on.2 min read

Scroll Axis Lock

css
1,722 views

I first noticed web scroll areas had scroll locking behavior when making 2D scroll snap demos; I couldn't scroll diagonally without getting hijacked and locked into an x or y axis.

Even on a touch device, where a diagonal gesture is so easy and natural.

Thanks to Bramus's rad interactive blog post I saw Chrome 153 with the remedy:

.scroller {
  overflow: auto;
  overscroll-behavior: contain;
  scroll-axis-lock: none; 👈
}

spec | check for support

Freedom from the axis lock 🤘🏻

Use cases #

I was thinking:

  1. swipe to dismiss interactions
  2. flings
  3. maps or infinite canvas navigating
  4. datagrids or tables
  5. image zoom scrolling around
  6. 360 pano images or 3D model panning
  7. data vis exploration

Just seems worth while to use the natural inertia, tensions, perf and feels that scroll snap has for the snap feedback of "didnt swipe far enough" and the browser owned easing.

Can also mitigate scrollTo strangeness that might do x then y.

I did log a bug #

I saw some performance regressions in the first 2 demo's I pulled up to test with

  1. swipe prototype
  2. snap matrix

Filed a bug.

I wouldn't necessarily file this as perfectly fixed, I still felt it was a bit clumsy or not enabling diagonal scrolling as smoothly as I'd like.

Overall exciting and meaningful IMO tho.

Your thoughts?

8 comments #

113likes

plus Josh, Kevin, vlt.io and 88 more

11reposts
  • Josh W. Comeau
  • Kevin Powell
  • Agustin Capeletto
  • ML | Merkyl
  • Felix
  • Daniel Schwarz

plus Josh, Kevin and 5 more

Join the conversation on

more info at @bram.us's post here (also where i first heard of this) www.bram.us/2026/08/09/u...
Adam ArgyleAdam Argyle
more info at @bramus post here (also where i first heard of this) https://t.co/SzCVqPzgDQ
Adam ArgyleAdam Argyle
Or not pls
moldy rye grainmoldy rye grain
@cozylittle.house for leaflet canvas pls ????????
Tynan Purdy ⁂Tynan Purdy ⁂
@argyleink 🤯🤯🤯
Rody DavisRody Davis
@argyleink wow we ran into this when developing a product comparison page: https://t.co/F9zQ27fIgB I even asked my coworker to create a css proposal but somehow we never found the time 😅 the requirement for us was to either lock on X or lock on Y but prevent free motion https://t.co/43N3TrYRXC
Jan NicklasJan Nicklas
@jantimon @argyleink https://t.co/Bn2oyJUs6I ;)
BramusBramus