Skip to content

Instantly share code, notes, and snippets.

View rkharsan's full-sized avatar

Rohit Kharsan rkharsan

View GitHub Profile
@pketh
pketh / gist:f6b37564b8f42fca7c61eb43c39287de
Last active June 26, 2026 15:50
disable ios text field autozoom
// https://stackoverflow.com/a/57527009
const disableIOSTextFieldZoom = () => {
if (!isIOS()) { return }
const element = document.querySelector('meta[name=viewport]')
if (element !== null) {
let content = element.getAttribute('content')
let scalePattern = /maximum\-scale=[0-9\.]+/g
if (scalePattern.test(content)) {
content = content.replace(scalePattern, 'maximum-scale=1.0')
} else {