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

Allow triggering the context menu before ContextMenuItems have been loaded #65

Open
isaacplmann opened this issue Nov 2, 2017 · 1 comment

Comments

@isaacplmann
Copy link
Owner

It would be nice if the context menu gracefully handled people trying to trigger it before the ContextMenuItems had been found by the ContextMenuComponent.

We could create a Subject that emits the menuItems in the ngAfterContentInit hook of the component and use that in the onMenuEvent method to only trigger the context menu after the menuItems are loaded.

Originally reported by @achyutgp in issue #6.

@sherlock1982
Copy link

Yes that's a nice idea. Currently I'm using it like this:

  1. Retrieve contextMenuActions anyhow, async way maybe.
  2. Call contextMenuService.show.next.

Would be nice to show a menu with a scroller and than show items.

Though there's one question here. For some reason currently I need to call setTimeout(() => contextMenuService.show.next) otherwise execute actions don't work.

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

2 participants