fix:composing input not save history

This commit is contained in:
Hufe921
2023-02-28 16:15:42 +08:00
parent 6e99d8ad93
commit c4f2687726
+6 -4
View File
@@ -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,