From c4f268772646f91d63c224cf72d5e23278ff2f5e Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Tue, 28 Feb 2023 16:15:42 +0800 Subject: [PATCH] fix:composing input not save history --- src/editor/core/event/handlers/input.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/editor/core/event/handlers/input.ts b/src/editor/core/event/handlers/input.ts index c0f000c..97c2e1b 100644 --- a/src/editor/core/event/handlers/input.ts +++ b/src/editor/core/event/handlers/input.ts @@ -17,8 +17,9 @@ export function input(data: string, host: CanvasEvent) { // 忽略选区部分在控件的输入 return } + const isComposing = host.isComposing // 移除合成输入 - if (!host.isComposing) { + if (!isComposing) { const cursor = draw.getCursor() cursor.clearAgentDomValue() } else { @@ -59,7 +60,7 @@ export function input(data: string, host: CanvasEvent) { } }) } - if (host.isComposing) { + if (isComposing) { newElement.underline = true } return newElement @@ -81,9 +82,10 @@ export function input(data: string, host: CanvasEvent) { } rangeManager.setRange(curIndex, curIndex) draw.render({ - curIndex + curIndex, + isSubmitHistory: !isComposing }) - if (host.isComposing) { + if (isComposing) { host.compositionInfo = { elementList, value: text,