diff --git a/lib/core/info-drawer/info-drawer.component.ts b/lib/core/info-drawer/info-drawer.component.ts index 532efb6ab1..77419804c5 100644 --- a/lib/core/info-drawer/info-drawer.component.ts +++ b/lib/core/info-drawer/info-drawer.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; +import { Component, ContentChildren, EventEmitter, HostListener, Input, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; import { MatTabChangeEvent } from '@angular/material/tabs'; @Component({ selector: 'adf-info-drawer-tab', @@ -61,6 +61,16 @@ export class InfoDrawerComponent { @ContentChildren(InfoDrawerTabComponent) contentBlocks: QueryList; + @HostListener('keydown', ['$event']) + onKeyDown(event: KeyboardEvent) { + event.cancelBubble = true; + } + + @HostListener('keyup', ['$event']) + onKeyUp(event: KeyboardEvent) { + event.cancelBubble = true; + } + showTabLayout(): boolean { return this.contentBlocks.length > 0; } diff --git a/lib/core/viewer/components/viewer-sidebar.component.ts b/lib/core/viewer/components/viewer-sidebar.component.ts index d0bd74fc54..5387279d1c 100644 --- a/lib/core/viewer/components/viewer-sidebar.component.ts +++ b/lib/core/viewer/components/viewer-sidebar.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; +import { ChangeDetectionStrategy, Component, HostListener, ViewEncapsulation } from '@angular/core'; @Component({ selector: 'adf-viewer-sidebar', @@ -25,4 +25,13 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/ template: `` }) export class ViewerSidebarComponent { + @HostListener('keydown', ['$event']) + onKeyDown(event: KeyboardEvent) { + event.cancelBubble = true; + } + + @HostListener('keyup', ['$event']) + onKeyUp(event: KeyboardEvent) { + event.cancelBubble = true; + } }