From 1a54217bfb66a242be7440af4630fa177ba9ae9c Mon Sep 17 00:00:00 2001 From: Teigen Date: Mon, 15 Jun 2026 17:33:31 +0800 Subject: [PATCH] fix(mobile): don't clear textarea during compositionstart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Programmatic _textarea.value = '' during compositionstart cancels the active IME composition on iOS Safari, breaking Chinese character input. The phantom (U+200B) is invisible and _strip() already removes it before sending to PTY — no need to clear it manually. --- src/web/public/input-cjk.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/web/public/input-cjk.js b/src/web/public/input-cjk.js index 72305c82..cb398548 100644 --- a/src/web/public/input-cjk.js +++ b/src/web/public/input-cjk.js @@ -113,11 +113,9 @@ const CjkInput = (() => { // ── Composition tracking ── _listeners.compositionstart = () => { _composing = true; - // Clear phantom so IME sees a clean textarea — some IMEs include - // existing text in the composition region which would corrupt input. - if (_textarea.value === PHANTOM) { - _textarea.value = ''; - } + // Leave textarea.value untouched — programmatic changes during + // compositionstart cancel the IME composition on iOS Safari. + // The phantom (U+200B) is invisible and _strip() removes it on flush. }; _listeners.compositionend = () => { _composing = false;