mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 08:59:40 +02:00
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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user