🎨 刚创建时无 id,更新需和 oldValue 保持一致

This commit is contained in:
Vanessa 2024-04-14 08:45:42 +08:00
parent e4c6191379
commit e8017741d9

View file

@ -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);