Vanessa 2024-12-13 10:42:45 +08:00
parent 441b6f7f65
commit b60f84fe09
5 changed files with 118 additions and 5 deletions

View file

@ -34,7 +34,7 @@ export const addFilesToDatabase = (fileLiElements: Element[]) => {
};
export const addEditorToDatabase = (protyle: IProtyle, range: Range, type?: string) => {
if (protyle.title?.editElement?.contains(range.startContainer) || type === "title") {
if ((range && protyle.title?.editElement?.contains(range.startContainer)) || type === "title") {
openSearchAV("", protyle.breadcrumb.element, (listItemElement) => {
const avID = listItemElement.dataset.avId;
transaction(protyle, [{