From 012dc7debcce4366c8e094cbc2af1a7892227ad2 Mon Sep 17 00:00:00 2001 From: Yeessang <59079308+Yeessang@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:42:27 +0800 Subject: [PATCH] fix: locate catalog when the context is within the table --- src/editor/core/command/CommandAdapt.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor/core/command/CommandAdapt.ts b/src/editor/core/command/CommandAdapt.ts index a3519b77..e9137469 100644 --- a/src/editor/core/command/CommandAdapt.ts +++ b/src/editor/core/command/CommandAdapt.ts @@ -1916,7 +1916,7 @@ export class CommandAdapt { } public locationCatalog(titleId: string) { - const elementList = this.draw.getMainElementList() + const elementList = this.draw.getOriginalMainElementList() let newIndex = -1 for (let e = 0; e < elementList.length; e++) { const element = elementList[e] @@ -1929,6 +1929,9 @@ export class CommandAdapt { } } if (!~newIndex) return + this.position.setPositionContext({ + isTable: false + }) this.range.setRange(newIndex, newIndex) this.draw.render({ curIndex: newIndex,