diff --git a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts index ec3b87e49..eae606c2f 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/file-workload/file-workload.component.ts @@ -596,7 +596,7 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnInit, On @HostListener('document: click') clickOutsideWorkloadView() { - if (this.multiSelectService.active()) { + if (this.multiSelectService.active() && !this._dialog.openDialogs.length) { this.multiSelectService.deactivate(); } } diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 86c838768..3c1fdfbdc 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -282,17 +282,21 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni @Bind() handleViewerClick(event: MouseEvent) { this._ngZone.run(() => { - if (this._multiSelectService.active()) { + if (event.isTrusted) { const clickedElement = event.target as HTMLElement; - if ( - clickedElement.querySelector('#selectionrect') || - clickedElement.id === `pageWidgetContainer${this.pdf.currentPage()}` - ) { - if (!this._annotationManager.selected.length) { + const editingAnnotation = + (clickedElement as HTMLImageElement).src?.includes('edit.svg') || clickedElement.getAttribute('aria-label') === 'Edit'; + if (this._multiSelectService.active() && !editingAnnotation) { + if ( + clickedElement.querySelector('#selectionrect') || + clickedElement.id === `pageWidgetContainer${this.pdf.currentPage()}` + ) { + if (!this._annotationManager.selected.length) { + this._multiSelectService.deactivate(); + } + } else { this._multiSelectService.deactivate(); } - } else { - this._multiSelectService.deactivate(); } } });