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

NbMenuItem is not applied 'active' styles if fragments are used in URL #875

Closed
1 task done
denisobrienirl opened this issue Oct 8, 2018 · 2 comments · Fixed by #1034
Closed
1 task done

NbMenuItem is not applied 'active' styles if fragments are used in URL #875

denisobrienirl opened this issue Oct 8, 2018 · 2 comments · Fixed by #1034

Comments

@denisobrienirl
Copy link

denisobrienirl commented Oct 8, 2018

Issue type

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

  • bug report

Issue description

Current behavior:
It appears that 'active' state is set to the first NbMenuItem if the URL contains a fragment - #something. My understanding is that 'pathMatch' property is setting the first matching NbMenuItem in the menu as 'selected' on every URL change, so no matter what you chose in the menu - the top item will always get 'active' styles applied.

Expected behavior:
'active' styles are toggled per NbMenuItem selected

Steps to reproduce:
My sub-menu contains the items that link to the following:
/pages/report/f75287ea1ed31a56cd912a6c86333b9cd4bcb852#top
/pages/report/f75287ea1ed31a56cd912a6c86333b9cd4bcb852#findings
/pages/report/f75287ea1ed31a56cd912a6c86333b9cd4bcb852#conclusion
/pages/report/f75287ea1ed31a56cd912a6c86333b9cd4bcb852#metadata

Clicking on any of the items will update URL and do other business logic, but will not set the selected item styles to 'active'.

peek 2018-10-08 23-19

NOTE this problem does not exist in ngx-admin demo, but sub-menu there links to URLs that do not use fragments.

Related code:
Not sure how relevant this piece is, but that's how NbMenuItem is created in my code.

const navigationItem = {
      title: itemName,
      icon: itemIcon,
      hidden: false,
      link: `/pages/report/${itemPath}`,
      fragment: itemFragment,
    }

Other information:

npm: 6.0.1
node: v10.11.0
OS: Linux 4.15.0-36-generic #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Browser: Chrome, Firefox

Angular, Nebular

"@angular/core": "^6.1.9",
"@nebular/auth": "^2.0.1",
"@nebular/bootstrap": "^2.0.1",
"@nebular/security": "^2.0.1",
@rakesh0692
Copy link

I have same issue, Please someone advise.

@nnixaa nnixaa added this to the 3.0.1 milestone Nov 19, 2018
@issue-sh issue-sh bot added Sprint and removed Backlog labels Nov 22, 2018
@issue-sh issue-sh bot added Backlog and removed Sprint labels Nov 29, 2018
@issue-sh issue-sh bot assigned Tibing and unassigned nnixaa Nov 30, 2018
@issue-sh issue-sh bot added In Review and removed In Progress labels Dec 6, 2018
@nnixaa nnixaa modified the milestones: 3.0.1, 3.1.0 Dec 8, 2018
@issue-sh issue-sh bot added Backlog and removed In Progress labels Dec 13, 2018
@Tibing
Copy link
Member

Tibing commented Dec 17, 2018

Blocked by #1041

@nnixaa nnixaa modified the milestones: 3.1.0, 3.2.0 Dec 30, 2018
@nnixaa nnixaa modified the milestones: 3.2.0, 3.3.0 Jan 16, 2019
@issue-sh issue-sh bot assigned nnixaa and unassigned Tibing Jan 24, 2019
@Tibing Tibing added this to Sprint in Nebular via automation Feb 21, 2019
@yggg yggg moved this from Sprint to In progress in Nebular Mar 13, 2019
@yggg yggg modified the milestones: 3.4.1, 3.4.2 Mar 13, 2019
@yggg yggg removed this from In progress in Nebular Mar 13, 2019
@yggg yggg added this to Sprint in Nebular via automation Mar 28, 2019
@yggg yggg moved this from Sprint to Needs review in Nebular Mar 28, 2019
@yggg yggg moved this from Needs review to In progress in Nebular Mar 29, 2019
@yggg yggg moved this from In progress to Needs review in Nebular Mar 30, 2019
Nebular automation moved this from Needs review to Done Mar 31, 2019
nnixaa pushed a commit that referenced this issue Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Nebular
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants