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

Change detection for visible attribute

Open schill32 opened this issue 5 years ago • 4 comments

I have a span that has a context menu enclosed. When the (contextmenu) event fires, the code will run and set some class variables which are then used in the ng-template. Below is a small example of this...

<span [contextMenu]="myContextMenu" (contextmenu)="handleMenu($event)">
<context-menu #myContextMenu>
<ng-template
            contextMenuItem
            [visible]="
              this.createMenuOptionVisible

What I'm seeing is that when my event handler for the context menu event is fired, the variable is set to true and thus the context menu item should be displayed. What I am seeing however is that is only happens the second time the span is right-clicked. The initial right-click, even though the variable is getting set to true, the item is still not being displayed. Is there something that I'm missing?

schill32 avatar Sep 22 '20 21:09 schill32

I'm having the same issue

lunar-consultancy avatar Feb 03 '21 09:02 lunar-consultancy

I'm also having this issue.

andy008 avatar Jun 12 '21 05:06 andy008

Same issue.

AmirSavand avatar Jun 22 '21 09:06 AmirSavand

Same issue.

But the only solvation is to disable it with some variable.

AmerAnsari avatar Jun 22 '21 10:06 AmerAnsari