Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Enter key not executing the menu item function #218

Open
Navyasri-K opened this issue Dec 9, 2020 · 1 comment
Open

On Enter key not executing the menu item function #218

Navyasri-K opened this issue Dec 9, 2020 · 1 comment

Comments

@Navyasri-K
Copy link

Navyasri-K commented Dec 9, 2020

Angular version: 5
ContextMenu version: 5.0.3
public onContextMenu(contextMenu, contextMenuService, $event: KeyboardEvent, item: any, index): void {

contextMenuService.show.next({
  contextMenu: contextMenu,
  event: $event,
  item: item
});

$event.preventDefault();
$event.stopPropagation();

}

When enter click on selected menu item. it is not executing the function. Tried to debug with Package code.

ContextMenuContentComponent.prototype.keyboardMenuItemSelect = /**
* @param {?=} event
* @return {?}
*/
function (event) {
console.log('Raised event')
if (!this.isLeaf) {
return;
}
this.cancelEvent(event);
this.menuItems[this._keyManager.activeItemIndex]; always getting -1 and activeItem as undefined
if (menuItem) {
this.onMenuItemSelect(menuItem, event);
}
};

@Navyasri-K
Copy link
Author

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant