[PM-7278] Fix undefined reference to `keyManager` within `menu-trigger-for` directive (#8614)

This commit is contained in:
Cesar Gonzalez 2024-04-04 09:57:10 -05:00 committed by GitHub
parent bf2f570b61
commit e2e593c0fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -88,12 +88,12 @@ export class MenuTriggerForDirective implements OnDestroy {
}
this.destroyMenu();
});
this.menu.keyManager.setFirstItemActive();
this.keyDownEventsSub =
this.menu.keyManager &&
this.overlayRef
if (this.menu.keyManager) {
this.menu.keyManager.setFirstItemActive();
this.keyDownEventsSub = this.overlayRef
.keydownEvents()
.subscribe((event: KeyboardEvent) => this.menu.keyManager.onKeydown(event));
}
}
private destroyMenu() {