From ae1c137b6129e402d2649a79ef93da899aa3480d Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 22 Oct 2024 16:42:40 +0300 Subject: [PATCH] RED-9944 - Action Items don't appear in document area in webviewer when bulk-select is still unintenionally active --- .../modules/file-preview/file-preview-screen.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 18585f821..bf9f2fd4e 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 @@ -302,6 +302,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni this._viewerHeaderService.enableLoadAllAnnotations(); // Reset the button state (since the viewer is reused between files) super.ngOnDetach(); this.pdf.instance.UI.hotkeys.off('esc'); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick); this._changeRef.markForCheck(); } @@ -337,7 +338,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni this._ngZone.run(() => { if (this._multiSelectService.active()) { const clickedElement = event.target as HTMLElement; - if (clickedElement.querySelector('#selectionrect')) { + if ( + clickedElement.querySelector('#selectionrect') || + clickedElement.id === `pageWidgetContainer${this.pdf.currentPage()}` + ) { if (!this._annotationManager.selected.length) { this._multiSelectService.deactivate(); } @@ -378,6 +382,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni this.#restoreOldFilters(); this.pdf.instance.UI.hotkeys.on('esc', this.handleEscInsideViewer); this._viewerHeaderService.resetLayers(); + this.pdf.instance.UI.iframeWindow.document.removeEventListener('click', this.handleViewerClick); this.pdf.instance.UI.iframeWindow.document.addEventListener('click', this.handleViewerClick); }