From 7260b6439bd36f961f545c43e1536b3538dd586a Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Sat, 2 Sep 2023 09:38:35 +0800 Subject: [PATCH] fix: table selection boundary error --- src/editor/core/event/handlers/mousemove.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/core/event/handlers/mousemove.ts b/src/editor/core/event/handlers/mousemove.ts index 2f00803..5a59802 100644 --- a/src/editor/core/event/handlers/mousemove.ts +++ b/src/editor/core/event/handlers/mousemove.ts @@ -46,7 +46,8 @@ export function mousemove(evt: MouseEvent, host: CanvasEvent) { index: startIndex, isTable: startIsTable, tdIndex: startTdIndex, - trIndex: startTrIndex + trIndex: startTrIndex, + tableId: startTableId } = host.mouseDownStartPosition const endIndex = isTable ? tdValueIndex! : index // 判断是否是表格跨行/列 @@ -67,6 +68,8 @@ export function mousemove(evt: MouseEvent, host: CanvasEvent) { ) } else { let end = ~endIndex ? endIndex : 0 + // 开始或结束位置存在表格,但是非相同表格则忽略选区设置 + if ((startIsTable || isTable) && startTableId !== tableId) return // 开始位置 let start = startIndex if (start > end) {