From 7d1a62a610c3ac7c91add1c9ee0e86d319718308 Mon Sep 17 00:00:00 2001 From: Adib Hanna Date: Fri, 28 Aug 2026 10:57:57 -0500 Subject: [PATCH] chore: hide the attach file input off-screen, matching the iOS shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The iOS port found that WebKit won't present a picker for a display:none file input; the iOS copy of attach.ts positions it off-screen instead. Android's WebView accepts either, so this only keeps the two shells' attach.ts identical — no behavior change on Android. --- src/ui-mobile/attach.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui-mobile/attach.ts b/src/ui-mobile/attach.ts index 56836ef..8860dcd 100644 --- a/src/ui-mobile/attach.ts +++ b/src/ui-mobile/attach.ts @@ -37,7 +37,10 @@ export function promptAttachFiles(): void { input.type = 'file' input.multiple = true input.className = INPUT_CLASS - input.style.display = 'none' + // Not display:none — WebKit (the iOS shell) declines to present the picker + // for an input that isn't rendered; Android's WebView doesn't care, but the + // two shells share this file line for line. Off-screen and transparent. + input.style.cssText = 'position:fixed;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none' document.body.appendChild(input) input.addEventListener('cancel', () => input.remove())