Skip to content

fix: prevent iOS Safari global overscroll with modern CSS - #24

Open
Huxpro wants to merge 1 commit into
yyx990803:masterfrom
Huxpro:claude/fix-ios-safari-scroll-WD2ZG
Open

fix: prevent iOS Safari global overscroll with modern CSS#24
Huxpro wants to merge 1 commit into
yyx990803:masterfrom
Huxpro:claude/fix-ios-safari-scroll-WD2ZG

Conversation

@Huxpro

@Huxpro Huxpro commented Mar 8, 2026

Copy link
Copy Markdown

iOS Safari 11.3+ defaults touchmove listeners on document/body to passive, silently ignoring preventDefault(). This caused the native elastic overscroll to leak through despite the app's custom scroll implementation.

Changes:

  • Add overscroll-behavior: none on html/body and #wrapper to disable native overscroll bounce via CSS (supported since iOS Safari 16)
  • Add touch-action: none on body and #wrapper to tell the browser not to handle any default touch gestures
  • Set html to position: fixed to lock the viewport on iOS Safari
  • Use addEventListener with { passive: false } instead of Zepto .on() for the touchmove prevention listener, ensuring preventDefault() is actually honored
  • Add viewport-fit=cover to viewport meta for notched devices

https://claude.ai/code/session_01QJx2mW2xD7CvJMQNddUTGo

iOS Safari 11.3+ defaults touchmove listeners on document/body to
passive, silently ignoring preventDefault(). This caused the native
elastic overscroll to leak through despite the app's custom scroll
implementation.

Changes:
- Add overscroll-behavior: none on html/body and #wrapper to disable
  native overscroll bounce via CSS (supported since iOS Safari 16)
- Add touch-action: none on body and #wrapper to tell the browser
  not to handle any default touch gestures
- Set html to position: fixed to lock the viewport on iOS Safari
- Use addEventListener with { passive: false } instead of Zepto .on()
  for the touchmove prevention listener, ensuring preventDefault()
  is actually honored
- Add viewport-fit=cover to viewport meta for notched devices

https://claude.ai/code/session_01QJx2mW2xD7CvJMQNddUTGo
@netlify

netlify Bot commented Mar 8, 2026

Copy link
Copy Markdown

Deploy Preview for html-clear ready!

Name Link
🔨 Latest commit e87e1e5
🔍 Latest deploy log https://app.netlify.com/projects/html-clear/deploys/69ad08dc64b1260008daa873
😎 Deploy Preview https://deploy-preview-24--html-clear.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants