mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1144] fix keyboard navigation (#819)
This commit is contained in:
@@ -23,7 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
OnDestroy,
|
||||
ViewEncapsulation,
|
||||
HostListener
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
@@ -153,6 +159,18 @@ export class PreviewComponent extends PageComponent
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('document:keydown', ['$event'])
|
||||
handleKeyboardEvent(event: KeyboardEvent) {
|
||||
const key = event.keyCode;
|
||||
const rightArrow = 39;
|
||||
const leftArrow = 37;
|
||||
|
||||
if (key === rightArrow || key === leftArrow) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the visibility change of the Viewer component.
|
||||
* @param isVisible Indicator whether Viewer is visible or hidden.
|
||||
|
Reference in New Issue
Block a user