diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts index c0f7a721c..72da91296 100644 --- a/app/src/asset/anno.ts +++ b/app/src/asset/anno.ts @@ -197,8 +197,11 @@ export const initAnno = (element: HTMLElement, pdf: any) => { } else if (type === "remove") { const urlPath = pdf.appConfig.file.replace(location.origin, "").substr(1); const config = getConfig(pdf); - delete config[rectElement.getAttribute("data-node-id")]; - rectElement.remove(); + const id = rectElement.getAttribute("data-node-id") + delete config[id]; + element.querySelectorAll(`[data-node-id="${id}"]`).forEach(item => { + item.remove(); + }); fetchPost("/api/asset/setFileAnnotation", { path: urlPath + ".sya", data: JSON.stringify(config),