akveo / akveo/nebular

NbMenuItem is not applied 'active' styles if queryParams are used

Offen
#2,172 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
8.1k
Forks
1.5k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Issue type

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

* [x] bug report
* [ ] feature request

### Issue description

**Current behavior:**
It appears that 'active' state is set to the first NbMenuItem if the URL contains a queryParams - ?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/widget?naviID=67f05152-a2c0-4a41-aee5-b05edc6fe41a
/pages/report/widget?naviID=4cd3796c-141d-43cb-87d8-ecff08469d9a
/pages/report/widget?naviID=74903d6f-38df-4382-a5a4-92825f14c13a
/pages/report/widget?naviID=b99ee72b-d7ee-4636-b58e-77656c1f2d7b
Clicking on any of the items will update URL and do other business logic, but will not set the selected item styles to 'active'.

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

```
insert short code snippets here
```

### Other information:

**npm, node, OS, Browser**
```

```

**Angular, Nebular**
```

```

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.