From e8017741d95027c3cc6e4bd3491731144f3afcf2 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 14 Apr 2024 08:45:42 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=88=9A=E5=88=9B=E5=BB=BA=E6=97=B6?= =?UTF-8?q?=E6=97=A0=20id=EF=BC=8C=E6=9B=B4=E6=96=B0=E9=9C=80=E5=92=8C=20o?= =?UTF-8?q?ldValue=20=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/render/av/cell.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 5c4ca21ca..c909c551e 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -554,8 +554,8 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va } const rowID = rowElement.getAttribute("data-id"); - const cellId = item.getAttribute("data-id"); - const colId = item.getAttribute("data-col-id"); + const cellId = item.dataset.id; // 刚创建时无 id,更新需和 oldValue 保持一致 + const colId = item.dataset.colId; text += getCellText(item) + ((cellElements[elementIndex + 1] && item.nextElementSibling && item.nextElementSibling.isSameNode(cellElements[elementIndex + 1])) ? "\t" : "\n\n"); const oldValue = genCellValueByElement(type, item);