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

User Menu: close automatically when selecting an item #423

Closed
1 of 2 tasks
nnixaa opened this issue May 15, 2018 · 7 comments · Fixed by #728
Closed
1 of 2 tasks

User Menu: close automatically when selecting an item #423

nnixaa opened this issue May 15, 2018 · 7 comments · Fixed by #728

Comments

@nnixaa
Copy link
Collaborator

nnixaa commented May 15, 2018

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior:

akveo/ngx-admin#1674

@muysewinkel
Copy link

I believe this happening for all instances of nbContextMenu

@blankstar85
Copy link
Contributor

i'm confused, is this still open then? I am seeing the menu not close, but i do see tibing's code fix in nebular.

@muysewinkel
Copy link

No it is fixed.

Upgrade to
"@nebular/theme": "^2.0.0-rc.9",

and it is fixed

@blankstar85
Copy link
Contributor

blankstar85 commented Jul 17, 2018

Edit: (bad day)
Finally sitting back down to look at this, have a new laptop and have everything setup, and my project running again. I double checked the package.json and deleted the node_modules, followed by an npm install and then npm start. The context menu just sits after being clicked.

this is specifically for the user menu
userMenu = [{ title: 'Profile', link: '/pages/profile'}, { title: 'Log out' }];

@blankstar85
Copy link
Contributor

update: OK, I've narrowed down the behavior, but this may be over my head (I've been digging around). Closing the menu works when the link parameter isn't there. So in my example above the log out item works perfectly, however the profile item with the link doesn't. The router will navigate to the profile page, but the menu will remain open. Does the router navigation destroy the subscribed onItemClicked event?

@nnixaa nnixaa added this to the rc.10 milestone Jul 23, 2018
@ma7euus
Copy link

ma7euus commented Jul 24, 2018

I am with same problem. :(

@ma7euus
Copy link

ma7euus commented Jul 25, 2018

I "solved" this the problem with:
userMenu: NbMenuItem[] = [
{title: 'Profile', data: {path: '/profile'}},
{title: 'Logout', data: {path: '/logout'}}
];
ngOnInit() {
this.nbMenuService.onItemClick()
.pipe(
filter(({tag}) => tag === 'user-menu'),
map((item) => item),
)
.subscribe(({item}) => {
this.router.navigateByUrl(item.data.path);
});
}

@nnixaa nnixaa modified the milestones: rc.10, 2.0.0 Aug 8, 2018
nnixaa pushed a commit that referenced this issue Sep 20, 2018
…#728)

BREAKING CHANGE:

`NbMenuComponent` and `NbContextMenuDirective` now fire itemClick even if item with `routerLink` was clicked.

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

Successfully merging a pull request may close this issue.

5 participants