mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
prevent children events from bubbling up (#7040)
This commit is contained in:
@@ -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<InfoDrawerTabComponent>;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
@@ -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: `<ng-content></ng-content>`
|
||||
})
|
||||
export class ViewerSidebarComponent {
|
||||
@HostListener('keydown', ['$event'])
|
||||
onKeyDown(event: KeyboardEvent) {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
|
||||
@HostListener('keyup', ['$event'])
|
||||
onKeyUp(event: KeyboardEvent) {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user