Skip to content

MKI

Chrome adds a one-line CSS fix for diagonal scrolling

Chrome 153 ships the scroll-axis-lock property, letting map, canvas, and gallery UIs skip the JavaScript scroll hijack entirely.

If you have ever built a map, an infinite canvas, or a pinch-to-pan image gallery on the web, you have run into scroll axis locking. The browser watches the first few pixels of a scroll gesture, decides whether the user “meant” to scroll vertically or horizontally, and then snaps the rest of the gesture to that single axis. It is a sensible default for reading a feed. It is actively hostile to anything that wants to pan freely in two dimensions.

Chrome 153, which reached stable on September 8, 2026, ships a fix that has been requested for years: a CSS property called scroll-axis-lock that lets you opt an element out of that heuristic entirely. No touch handlers, no manual transform math, no fighting the browser’s scrolling engine. One declaration.

What changed

scroll-axis-lock is a new property defined in the CSS Overflow 5 specification, shipped in Chrome 153 per the official release notes and detailed in the WICG explainer from the Blink Interactions team. It takes two values:

.pan-container {
overflow: auto;
scroll-axis-lock: auto; /* default: browser may lock the gesture to one axis */
/* or */
scroll-axis-lock: none; /* browser must not lock; diagonal scroll follows the gesture exactly */
}

auto preserves today’s behavior, so nothing breaks for existing pages. Set none on a scroll container and the browser stops railing the gesture: touch, trackpad, and wheel input all scroll in both axes simultaneously, following the user’s actual movement instead of the browser’s guess about their intent. Chrome’s own walkthrough with side-by-side recordings shows the difference clearly: with auto, a circular scroll gesture comes out looking like an Etch A Sketch; with none, it traces the actual input.

Why this needed a CSS property in the first place

Axis locking is not a bug, and the explainer is explicit about why it exists: when someone drags a finger mostly vertically to scroll a feed, ignoring a few stray horizontal pixels prevents the page from drifting sideways. The problem is that the same heuristic applies uniformly, whether the container is a one-dimensional article or a two-dimensional map, and different browsers disagree on how aggressively to apply it. Safari and Firefox on macOS lock hard; Chrome on macOS tries to track intent more closely but still applies some locking; Safari on iOS reportedly does not lock diagonal panning by default, while Chrome on Android does. That inconsistency is exactly why a declarative, author-controlled property is more useful than trying to reverse-engineer per-browser thresholds.

What teams were doing instead

Before this property existed, the only way to get true diagonal scrolling was to bypass native scrolling altogether. The explainer’s own workaround example is worth looking at, because most homegrown map or whiteboard components on the web look close to this today:

element.addEventListener('touchstart', (e) => {
startX = e.touches[0].clientX
startY = e.touches[0].clientY
})
element.addEventListener('touchmove', (e) => {
e.preventDefault() // kill native scroll and axis locking
const dx = e.touches[0].clientX - startX
const dy = e.touches[0].clientY - startY
element.style.transform = `translate3d(${dx}px, ${dy}px, 0)`
})

This works, but it comes with real costs. Gesture handling now runs on the main thread instead of the browser’s dedicated scrolling thread, so any script contention shows up as jank. transform-based panning also opts you out of scroll snapping, IntersectionObserver, and scroll-driven animations unless you rebuild all of that logic by hand. And because touch-action only governs direct touch input, this workaround typically needs a second, separate code path for trackpad and wheel scrolling. Replacing all of that with one CSS declaration is a meaningful simplification, not just a syntactic nicety.

Why not just reuse touch-action?

The explainer’s team considered exactly that shortcut — either overloading touch-action: pan-x pan-y or adding a new keyword like pan-free — and rejected it for two reasons worth understanding, because they explain why scroll-axis-lock lives in CSS Overflow instead. First, touch-action governs whether the browser intercepts a gesture at all; axis locking happens later, once the browser’s scrolling engine is already processing that gesture, so folding the two together would blur two different stages of input handling. Second, touch-action only applies to direct touchscreen input. It has no effect on trackpad or mouse wheel scrolling, both of which can exhibit the same axis-locking behavior. Placing scroll-axis-lock in CSS Overflow instead — alongside scroll-snap-type and scroll-behavior — means it applies consistently across every input modality: touch, trackpad, and wheel alike. That consistency is exactly what a map or canvas component needs, since users pan those surfaces with all three.

It is also part of a broader, multi-year pattern of the CSS Working Group turning gesture and scroll behaviors that used to require JavaScript into declarative properties: overscroll-behavior for containing scroll chaining, scroll-snap-type for paging interfaces, scroll-driven animations for tying effects to scroll position. scroll-axis-lock fits that same trajectory — take a class of interaction that forced developers into manual touchmove handlers, and give the browser’s own compositor thread a declarative way to do it instead. The payoff each time is the same: smoother behavior, because the work happens off the main thread, and less code to maintain.

A worked example: migrating a map viewer

Here is roughly what a homegrown pan-and-zoom map component looks like today, stripped to the scrolling logic:

const viewport = document.querySelector('.map-viewport')
let startX = 0
let startY = 0
viewport.addEventListener('touchstart', (e) => {
startX = e.touches[0].clientX
startY = e.touches[0].clientY
})
viewport.addEventListener(
'touchmove',
(e) => {
e.preventDefault()
const dx = e.touches[0].clientX - startX
const dy = e.touches[0].clientY - startY
viewport.style.transform = `translate3d(${dx}px, ${dy}px, 0)`
},
{ passive: false },
)

With scroll-axis-lock, the equivalent is a native scroll container and one extra declaration:

<div class="map-viewport">
<div class="map-content"></div>
</div>
<style>
.map-viewport {
width: 100vw;
height: 100vh;
overflow: auto;
scroll-axis-lock: none;
}
.map-content {
width: 5000px;
height: 5000px;
}
</style>

No event listeners, no manual delta tracking, no preventDefault() fighting the browser for control of the gesture. Scroll snapping, IntersectionObserver, and scroll-driven animations all keep working on .map-viewport for free, because it is still a real native scroll container rather than a transform-driven fake one.

Where this actually matters

The explainer names two concrete use cases, and both map directly onto interfaces the web builds constantly: 2D panning surfaces (maps, architectural diagrams, infinite canvases, collaborative whiteboards) and 2D swipe-to-dismiss gestures, where a card should track a finger’s exact diagonal path instead of snapping to a rail. If you maintain a product with a map view, a Miro-style canvas, a photo viewer with pinch-and-pan, or a Tinder-style card stack, this property is aimed squarely at your component.

Accessibility is worth a note here too. The explainer’s own accessibility section flags that axis locking helps users who cannot swipe in a perfectly straight line, by preventing unintended sideways drift while reading a feed. scroll-axis-lock defaults to auto specifically so that behavior is preserved everywhere except where an author has deliberately opted out on a genuinely two-dimensional surface. That is the right default: this is a targeted escape hatch, not a global toggle.

The catch: it is Chromium-only, for now

As of Chrome 153, only Blink ships scroll-axis-lock. Firefox and Safari do not support it yet, and both engines have open tracking issues in their standards-positions repositories (Mozilla, WebKit) without a recorded position at the time of writing. That is a normal early stage for a CSS Working Group feature, not a red flag, but it does mean you cannot rely on it as your only scroll-handling strategy today.

The good news is that this ships safely as progressive enhancement. Unsupported browsers simply ignore the declaration and fall back to their existing default behavior, so there is no harm in adding it now. If you want to branch logic — for example, to skip loading a JavaScript panning library entirely when the browser already handles it — feature-detect with @supports:

@supports (scroll-axis-lock: none) {
/* native diagonal scrolling is available */
}
if (CSS.supports('scroll-axis-lock: none')) {
// native diagonal scrolling is available
}

What we’d do about it

For any client project with a map, canvas, or gallery component, we would add scroll-axis-lock: none to the relevant container today. It costs one line, degrades safely on Firefox and Safari, and removes real friction for every visitor on a Chromium-based browser in the meantime. We would not rip out an existing JavaScript panning fallback yet — Safari and Firefox support is unconfirmed, and touch-heavy products still need a working path on iOS Safari. But we would stop writing new custom gesture handlers for pure diagonal panning, since the CSS property now covers the common case with far less code to maintain.

It is also a good prompt to audit existing components: any touchmove handler with preventDefault() and manual transform math is a candidate for simplification once cross-browser support catches up, and @supports lets you start that migration incrementally instead of waiting for a single cutover date.

If you are scoping a new web app or product build with a spatial interface — maps, dashboards, design tools — this is worth raising during technical planning rather than after the custom gesture code is already written. We cover this kind of platform-tracking as part of ongoing performance and maintenance work for existing sites too.

Sources