Spaces:
Paused
Paused
Malina Claude Opus 4.8 commited on
Commit ·
96c418e
1
Parent(s): 409f4aa
aria(mobile): JS fallback to kill iOS double-tap zoom (non-passive touchend preventDefault); js v14
Browse files
cloudflare/pages-integration/aria.html
CHANGED
|
@@ -128,6 +128,6 @@
|
|
| 128 |
|
| 129 |
<div class="aria-toast" id="ariaToast" hidden></div>
|
| 130 |
|
| 131 |
-
<script type="module" src="js/aria-chat.js?v=
|
| 132 |
</body>
|
| 133 |
</html>
|
|
|
|
| 128 |
|
| 129 |
<div class="aria-toast" id="ariaToast" hidden></div>
|
| 130 |
|
| 131 |
+
<script type="module" src="js/aria-chat.js?v=14"></script>
|
| 132 |
</body>
|
| 133 |
</html>
|
cloudflare/pages-integration/js/aria-chat.js
CHANGED
|
@@ -462,6 +462,15 @@ function wireHold() {
|
|
| 462 |
msgs.addEventListener("pointercancel", () => { snapBack(true); row = null; mode = null; });
|
| 463 |
msgs.addEventListener("scroll", () => { clearTimeout(_pressTimer); closeHold(); }, { passive: true });
|
| 464 |
msgs.addEventListener("contextmenu", (e) => { if (e.target.closest(".aria-row")) e.preventDefault(); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
}
|
| 466 |
function ensureHoldDom() {
|
| 467 |
if (_overlay) return;
|
|
|
|
| 462 |
msgs.addEventListener("pointercancel", () => { snapBack(true); row = null; mode = null; });
|
| 463 |
msgs.addEventListener("scroll", () => { clearTimeout(_pressTimer); closeHold(); }, { passive: true });
|
| 464 |
msgs.addEventListener("contextmenu", (e) => { if (e.target.closest(".aria-row")) e.preventDefault(); });
|
| 465 |
+
// iOS Safari ignores touch-action:manipulation for double-tap zoom — so swallow the
|
| 466 |
+
// SECOND quick tap's default (the zoom gesture). Must be a non-passive listener for
|
| 467 |
+
// preventDefault to take effect. Double-tap-to-❤️ (pointer events) is unaffected.
|
| 468 |
+
let lastTouchEnd = 0;
|
| 469 |
+
msgs.addEventListener("touchend", (e) => {
|
| 470 |
+
const now = Date.now();
|
| 471 |
+
if (now - lastTouchEnd <= 350 && e.cancelable) e.preventDefault();
|
| 472 |
+
lastTouchEnd = now;
|
| 473 |
+
}, { passive: false });
|
| 474 |
}
|
| 475 |
function ensureHoldDom() {
|
| 476 |
if (_overlay) return;
|