fix: use rectEl instead of targetEl in delete handler

This commit is contained in:
Research Assistant 2026-05-20 19:08:02 +08:00
parent 6d2d761a31
commit bbd910c0f2

View file

@ -1150,7 +1150,7 @@ function showAnnotationPopover(event, ann, rectEl, vaultPath, pdfPath, container
hideAnnotationPopover();
if (result.ok) {
// Remove the rect element directly — no full rebuild
if (targetEl && targetEl.parentElement) targetEl.remove();
if (rectEl && rectEl.parentElement) rectEl.remove();
invalidateAnnotationCache();
} else {
console.warn('[PF] delete annotation failed:', result.error);