From d7870409c41cb477eb7fbc2cc4702e7605e696e6 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Fri, 6 Nov 2026 04:11:54 +0000 Subject: [PATCH] fix(mobile): close the details card when a touch lands outside it Co-authored-by: zhangxaochen <3416677+zhangxaochen@users.noreply.github.com> --- mobile/src/components/use-detail-card-scope.web.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mobile/src/components/use-detail-card-scope.web.ts b/mobile/src/components/use-detail-card-scope.web.ts index 173e1bb7f44..1059c97be94 100644 --- a/mobile/src/components/use-detail-card-scope.web.ts +++ b/mobile/src/components/use-detail-card-scope.web.ts @@ -47,7 +47,7 @@ export function useDetailCardScope({ record.restore = false dismiss() } - const click = (event: MouseEvent) => { + const press = (event: MouseEvent) => { if (!inside(event.target) && !headerBack(event.target)) { outside() } @@ -120,7 +120,9 @@ export function useDetailCardScope({ } } const capture = { capture: true, signal: listeners.signal } - document.addEventListener('click', click, capture) + // Why: iOS sends no click for a touch whose touchmove was prevented, as the terminal does for any finger movement. + document.addEventListener('pointerdown', press, capture) + document.addEventListener('click', press, capture) document.addEventListener('keydown', key, capture) document.addEventListener('keyup', key, capture) document.addEventListener('keydown', isolate, { signal: listeners.signal })