From 2b07d1a493ff0e595401a4b1dadbbc67617ef7c6 Mon Sep 17 00:00:00 2001 From: mooonfly Date: Fri, 11 Jul 2025 02:37:29 +0800 Subject: [PATCH] Fix duplicated character when composing text (#234) --- src-web/components/core/Editor/singleLine.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src-web/components/core/Editor/singleLine.ts b/src-web/components/core/Editor/singleLine.ts index 2b46e1ec..8e438ce9 100644 --- a/src-web/components/core/Editor/singleLine.ts +++ b/src-web/components/core/Editor/singleLine.ts @@ -6,6 +6,9 @@ export function singleLineExtensions(): Extension { (tr: Transaction): TransactionSpec | TransactionSpec[] => { if (!tr.isUserEvent('input')) return tr; + // when composing text via IME, return + if (tr.isUserEvent('input.type.compose')) return tr; + const specs: TransactionSpec[] = []; tr.changes.iterChanges((_, toA, fromB, toB, inserted) => { let insert = '';