mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 07:59:42 +02:00
fix: prevent iOS zoom on input focus and pinch-to-zoom
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -224,6 +224,14 @@ const MobileDetection = {
|
||||
resizeTimeout = setTimeout(() => this.updateBodyClass(), 100);
|
||||
};
|
||||
window.addEventListener('resize', this._resizeHandler);
|
||||
|
||||
// iOS: prevent pinch-to-zoom (Safari ignores user-scalable=no since iOS 10)
|
||||
if (this.isIOS()) {
|
||||
this._gestureStartHandler = (e) => e.preventDefault();
|
||||
this._gestureChangeHandler = (e) => e.preventDefault();
|
||||
document.addEventListener('gesturestart', this._gestureStartHandler);
|
||||
document.addEventListener('gesturechange', this._gestureChangeHandler);
|
||||
}
|
||||
},
|
||||
|
||||
/** Remove event listeners */
|
||||
@@ -232,6 +240,12 @@ const MobileDetection = {
|
||||
window.removeEventListener('resize', this._resizeHandler);
|
||||
this._resizeHandler = null;
|
||||
}
|
||||
if (this._gestureStartHandler) {
|
||||
document.removeEventListener('gesturestart', this._gestureStartHandler);
|
||||
document.removeEventListener('gesturechange', this._gestureChangeHandler);
|
||||
this._gestureStartHandler = null;
|
||||
this._gestureChangeHandler = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user