ngx-admin icon indicating copy to clipboard operation
ngx-admin copied to clipboard

NbContextMenu is slow with many instances

Open kingsimba opened this issue 1 year ago • 0 comments

Issue type

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

  • [x] bug report
  • [ ] feature request
  • [ ] question about the decisions made in the repository

Issue description

Current behavior:

I have a table of 150 lines. On each line there are 3 buttons, one of which has a context menu. The context menu is slow to pop. And double clicking on some texts(SN selecting) is also slow. Especially on Firefox (Chrome is much better).

Reducing 150 lines to 50 lines, there will be no noticeable delay.

image

<button nbButton ghost size="small" status="primary" class="device-name-btn"
            (click)="onClickDeviceSettings(device)" [nbContextMenu]="deviceSettingItems"
            nbContextMenuTag="device-settings-context-menu" *ngIf="userService.isInsider">
            <nb-icon icon="gear" pack="bootstrap-icons" nbTooltip="Settings" status="basic" style="font-size: 0.8rem;">
            </nb-icon>
          </button>

Workaround?

Is it because there are too many context menus? Can I create just one context menu programmatically and use it for all buttons? I assume this will boost performance?

Other information:

npm, node, OS, Browser

node: v14.19.3
npm: 6.14.17
OS: Windows 11
Browser: Firefox

Angular, Nebular

Angular: 12.0.4
Nebular: 8.0.0

kingsimba avatar Apr 12 '23 15:04 kingsimba