fix(mobile): don't clear textarea during compositionstart

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.
This commit is contained in:
Teigen
2026-06-17 23:40:04 +08:00
parent 70742d400a
commit 1a54217bfb
+3 -5
View File
@@ -113,11 +113,9 @@ const CjkInput = (() => {
// ── Composition tracking ── // ── Composition tracking ──
_listeners.compositionstart = () => { _listeners.compositionstart = () => {
_composing = true; _composing = true;
// Clear phantom so IME sees a clean textarea — some IMEs include // Leave textarea.value untouched — programmatic changes during
// existing text in the composition region which would corrupt input. // compositionstart cancel the IME composition on iOS Safari.
if (_textarea.value === PHANTOM) { // The phantom (U+200B) is invisible and _strip() removes it on flush.
_textarea.value = '';
}
}; };
_listeners.compositionend = () => { _listeners.compositionend = () => {
_composing = false; _composing = false;