diff --git a/frontend/src/lib/components/PdfViewer.svelte b/frontend/src/lib/components/PdfViewer.svelte index cd51b52a..1a9ff68a 100644 --- a/frontend/src/lib/components/PdfViewer.svelte +++ b/frontend/src/lib/components/PdfViewer.svelte @@ -452,18 +452,20 @@ function zoomOut() { {/if} - {#if activeAnnotationId} - (activeAnnotationId = null)} - onCountChange={(count) => { - if (activeAnnotationId) commentCounts.set(activeAnnotationId, count); - }} - /> - {/if} + {#key activeAnnotationId} + {#if activeAnnotationId} + (activeAnnotationId = null)} + onCountChange={(count) => { + if (activeAnnotationId) commentCounts.set(activeAnnotationId, count); + }} + /> + {/if} + {/key} {/if}