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 ──
_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;