RED-5238: fix auto select annotation on win virtual desktops

This commit is contained in:
Dan Percic 2022-12-12 16:11:24 +02:00
parent d04c63c8f5
commit 199abf525d
2 changed files with 8 additions and 2 deletions

View File

@ -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();

View File

@ -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();