akveo / akveo/nebular

feature request: control expanded menu items

Open
#2,266 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue type

**I'm submitting a ...**

* [ ] bug report
* [x] feature request

### Issue description

**Current behavior:**
`NbMenuComponent`accepts an array of `NbMenuItem`. Some of these items can have children (subitems) and I can control their default `expanded` state. The problem is that there is no way to listen on clicks on these items and programatically change their `expanded` state.

**Expected behavior:**
One example could be lazy loading of menu subitems. When I click to expand a menu item, I need to go and fetch the subitems and then update the menu with the full picture and then I actually want the expand action to take place.

**Steps to reproduce:**
1. create `nb-menu` component with items that have subitems
2. set `expanded` on such an item to `false`.
3. click on the item
4. item expands itself but I wish we are able to control when this item actually expands

**Angular, Nebular**
```
"@angular/core": "~8.2.14",
"@nebular/theme": "4.6.0"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.