Disconnect the context-menu when empty or null items
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Issue type
**I'm submitting a ...** (check one with "x")
* [ ] bug report
* [X] feature request
### Issue description
**Current behavior:**
When our nbContextMenu is empty (or null), we have to handle an ugly ngIf around that element. Potentially having twice the same tags, but just one with the [nbContextMenu] attribute and one without.
**Expected behavior:**
The nbContextMenu could simply disconnect the `dynamicOverlayHandler` when the item list is empty rather than calling a `validateItems`. That way we could support receiving the menuItems later or not having menuItems at all in some cases.
**Steps to reproduce:**
`[nbContextMenu]="null"` or `[nbContextMenu]="[]"` should just be handled. Nothing should show.
**Related code:**
### Other information:
**Angular, Nebular**
Angular: 8.2.14
Nebular: 4.6.0
贡献指南
评估
这个 Issue 还没有评估数据。