Vanessa 2024-06-20 20:26:57 +08:00
parent efcba48f90
commit ba160d1f44
3 changed files with 9 additions and 4 deletions

View file

@ -459,9 +459,8 @@ ${genHintItemHTML(item)}
});
updateAttrViewCellAnimation(cellElement, {
type: "block",
id: newID,
isDetached: false,
block: {content: realFileName}
block: {content: realFileName, id: newID}
});
} else {
const sourceId = tempElement.getAttribute("data-id");
@ -481,9 +480,8 @@ ${genHintItemHTML(item)}
}]);
updateAttrViewCellAnimation(cellElement, {
type: "block",
id: sourceId,
isDetached: false,
block: {content: tempElement.textContent}
block: {content: tempElement.textContent, id: sourceId}
});
}
return;

View file

@ -701,6 +701,8 @@ export const renderCellAttr = (cellElement: Element, value: IAVCellValue) => {
}
if (value.isDetached) {
cellElement.setAttribute("data-detached", "true");
} else {
cellElement.removeAttribute("data-detached");
}
}
};

View file

@ -173,6 +173,11 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
nextID: previousID,
isDetached: selectCellElement.dataset.detached === "true",
}]);
updateAttrViewCellAnimation(selectCellElement, {
type: "block",
isDetached: false,
block: {content: contenteditableElement.firstElementChild.textContent, id: sourceId}
});
return;
}
}