From 272760c3213520e98b04a0453d21ad91e75d56ab Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Wed, 28 Oct 2026 08:37:27 -0400 Subject: [PATCH] iPad: no text selection or image menu on press-and-hold, no accidental pinch or double-tap zoom, fields stay at 16px so focus does not zoom Co-Authored-By: Claude Sonnet 5.5 --- public/boot.js | 2 ++ public/style.css | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/public/boot.js b/public/boot.js index b4938fd..0fd5951 100644 --- a/public/boot.js +++ b/public/boot.js @@ -1,5 +1,7 @@ 'use strict'; // ---- Boot +// Stop the accidental pinch zoom on iPads (Safari ignores user-scalable=no). Double-tap zoom is stopped in the CSS (touch-action: manipulation). +for (const ev of ['gesturestart', 'gesturechange', 'gestureend']) document.addEventListener(ev, e => e.preventDefault(), { passive: false }); (async () => { try { cfg = { ...cfg, ...(await (await fetch('/api/config')).json()) }; } catch {} const loadedBuild = cfg.build; diff --git a/public/style.css b/public/style.css index cff729e..f823683 100644 --- a/public/style.css +++ b/public/style.css @@ -1188,3 +1188,12 @@ body.qdock #view { padding-right: 340px; } #qdock .num { width: 22px; text-align: center; color: var(--muted); font-size: 13px; flex: none; } #qdock .qrow.now .num, #qdock .qrow.now b { color: var(--accent); } #qdock .grow { min-width: 0; } #qdock b, #qdock small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #qdock .qmain small { color: var(--muted); font-size: 12px; } #qdock .qfoot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); } #qdock .qfoot .btn { flex: 1; justify-content: center; } + +/* touch screens (iPad): pressing and holding does not select text or open the image menu, and a double tap does not zoom. + Text you would want to copy (mail, notes, messages, the page text in the reader) and every text field stay selectable. */ +@media (pointer: coarse) { + html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; } + input, textarea, select, [contenteditable], .mbody, .mbody *, .ntbody, .ntbody *, .sgmsgs, .sgmsgs *, .textLayer, .textLayer *, .selectable, .selectable * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; } + img, svg, a, button { -webkit-touch-callout: none; -webkit-user-drag: none; } + input, textarea, select { font-size: max(16px, 1em); } /* (iPadOS zooms the page when a smaller field is focused) */ +}