brtnshrdr / angular2-hotkeys

Keyboard shortcuts for Angular 2 apps
MIT License
203 stars 95 forks source link

Is it possible to prevent hotkeys being active in a material select? #151

Closed AshMcConnell closed 3 years ago

AshMcConnell commented 3 years ago

Hi Folks,

We are having a slight problem where the mat-select is firing hotkey events. Is there any way to avoid this?

Thanks for your help Ash

AshMcConnell commented 3 years ago

I realised I can check for mat-select when handling the shortcut: -

private handleShortcut($event): void {
        if ($event.target.nodeName === 'MAT-SELECT') {
            return;
        }
       ....
}