Atlaslog
Atlaslog / Field Notes / Interaction
Field note · Interaction

Mobile gesture conflicts and scroll bleed-through

Quick answer

Dragging the map scrolls the page, pinching zooms the page instead of the map, and a full-width map traps the page so it can never be scrolled past. The causes are touch-action defaults, the viewport meta tag and an unlocked body behind fullscreen overlays.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: Leaflet · OpenLayers · Cesium
Symptom
Checklist
  1. Check the map container's touch-action; a value such as pan-y lets the browser take the gesture first.
  2. Check whether the map fills the entire viewport height, leaving nothing to scroll.
  3. Distinguish page zoom from map zoom, since the first is the viewport meta tag and the second is gesture configuration.
  4. Check whether body scroll is locked while an overlay is open, including position fixed for iOS.
  5. Test on a real device instead of relying on the desktop emulator.
Fix

Set touch-action: none on the map container, keep width=device-width in the viewport and add user-scalable=no only on precision map pages. Lock the body with overflow hidden plus position fixed on iOS, restoring scrollTop on unlock, and cap map height near half the viewport so the page stays scrollable.

Code
#map {
  touch-action: none;
}
<meta name="viewport"
      content="width=device-width, initial-scale=1,
               maximum-scale=1, user-scalable=no">
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). Mobile gesture conflicts and scroll bleed-through. https://www.jingweizhi.com/en/cookbook/mobile-gesture.html (accessed 2026-11-03).