🐛 数据库 tab 修改没有内容的单元格

This commit is contained in:
Vanessa 2023-12-13 22:13:37 +08:00
parent ce82f62840
commit 8527b868c6

View file

@ -250,10 +250,15 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem
cellElements[0] = protyle.wysiwyg.element.querySelector(previousId ? `[data-av-id="${avid}"] .av__row[data-id="${previousId}"]` : `[data-av-id="${avid}"] .av__row--header`).nextElementSibling.querySelector('[data-detached="true"]');
} else {
// 修改单元格后立即修改其他单元格
cellElements[0] = protyle.wysiwyg.element.querySelector(`.av__cell[data-id="${cellElements[0].dataset.id}"]`);
if (!cellElements[0]) {
let tempElement = protyle.wysiwyg.element.querySelector(`.av__cell[data-id="${cellElements[0].dataset.id}"]`) as HTMLElement;
if (!tempElement) {
// 修改单元格后修改其他没有内容的单元格id 会随机)
tempElement = protyle.wysiwyg.element.querySelector(`.av__row[data-id="${rowElement.dataset.id}"] .av__cell[data-col-id="${cellElements[0].dataset.colId}"]`) as HTMLElement
}
if (!tempElement) {
return;
}
cellElements[0] = tempElement;
}
}
if (cellElements.length === 1 && cellElements[0].dataset.detached === "true" && !rowElement.dataset.id) {