From 72073a0b407f52db73dd0e2fb97173113358ec71 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 18 Apr 2024 11:29:05 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/11051 --- app/src/protyle/render/av/col.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts index 9655a1927..e94af8b77 100644 --- a/app/src/protyle/render/av/col.ts +++ b/app/src/protyle/render/av/col.ts @@ -787,12 +787,14 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen } menu.addSeparator(); } - menu.addItem({ icon: "iconInsertLeft", label: window.siyuan.languages.insertColumnLeft, click() { const addMenu = addCol(protyle, blockElement, cellElement.previousElementSibling?.getAttribute("data-col-id") || ""); + if (!blockElement.contains(cellElement)) { + cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`) + } const addRect = cellElement.getBoundingClientRect(); addMenu.open({ x: addRect.left, @@ -805,7 +807,10 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen icon: "iconInsertRight", label: window.siyuan.languages.insertColumnRight, click() { - const addMenu = addCol(protyle, blockElement, cellElement.getAttribute("data-col-id") || ""); + const addMenu = addCol(protyle, blockElement, colId); + if (!blockElement.contains(cellElement)) { + cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`) + } const addRect = cellElement.getBoundingClientRect(); addMenu.open({ x: addRect.left,