From 199abf525daedbc3e2824fdead3e763ca7648c76 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Mon, 12 Dec 2022 16:11:24 +0200 Subject: [PATCH] RED-5238: fix auto select annotation on win virtual desktops --- .../components/file-workload/file-workload.component.ts | 5 +++-- .../modules/pdf-viewer/services/document-viewer.service.ts | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) 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 29be6a15d..8b376701f 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 @@ -214,18 +214,19 @@ export class FileWorkloadComponent extends AutoUnsubscribe implements OnDestroy return; } - if ($event.key === 'ArrowLeft') { + if (!$event.metaKey && !$event.ctrlKey && $event.key === 'ArrowLeft') { this.pagesPanelActive = true; this._changeDetectorRef.markForCheck(); return; } - if ($event.key === 'ArrowRight') { + if (!$event.metaKey && !$event.ctrlKey && $event.key === 'ArrowRight') { this.pagesPanelActive = false; // if we activated annotationsPanel - // select first annotation from this page in case there is no // selected annotation on this page and not in multi select mode if (!this.pagesPanelActive && !this.multiSelectService.isActive) { + this._documentViewer.clearSelection(); this._selectFirstAnnotationOnCurrentPageIfNecessary(); } this._changeDetectorRef.markForCheck(); diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts index cbc960487..0082f6ddc 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/document-viewer.service.ts @@ -80,6 +80,11 @@ export class REDDocumentViewer { return merge(this.#documentUnloaded$, this.#documentLoaded$).pipe(shareLast()); } + clearSelection() { + this.#document.clearSelection(); + this.#pdf.disable('textPopup'); + } + close() { this.#logger.info('[PDF] Closing document'); this.#document.closeDocument();