diff --git a/projects/ngx-contextmenu/src/lib/contextMenuContent.component.ts b/projects/ngx-contextmenu/src/lib/contextMenuContent.component.ts index a27e1c2..0222af1 100644 --- a/projects/ngx-contextmenu/src/lib/contextMenuContent.component.ts +++ b/projects/ngx-contextmenu/src/lib/contextMenuContent.component.ts @@ -213,6 +213,11 @@ export class ContextMenuContentComponent return; } this._keyManager.onKeydown(event); + const activeItemIndex = this._keyManager.activeItemIndex; + const menuItemElement = this.menuItemElements.toArray()[activeItemIndex]; + if (menuItemElement) { + menuItemElement.nativeElement.scrollIntoViewIfNeeded(); + } } @HostListener('window:keydown.ArrowRight', ['$event'])