primeng icon indicating copy to clipboard operation
primeng copied to clipboard

popup-menu doesn't propagate clicks with menu-structure that was generate by function

Open Pranen opened this issue 10 years ago • 2 comments

Hi

If I generate my menu-structure as a global var, everything works.

Example:

contextMenu = [
        {
            label: 'Option 1 '
        },
        {
            label: 'Option 2'
        }
    ];

But If I create the same structure by function-call

getContextMenu() {
  return [
        {
            label: 'Option 1 '
        },
        {
            label: 'Option 2'
        }
    ];

the menu is showing but no click-event is propagated.

If I just return the contextMenu by the function call, everything works.

getContextMenu() {
  return this.contextMenu;
}

The used html-code is:

p-menu #menuButton popup="popup" 
                            [model]="getContextMenu()"></p-menu>
                    <button type="button" pButton icon="fa-reorder" 
                            (click)="menuButton.toggle($event)"></button>

Regards, Peter

Pranen avatar Jun 03 '16 11:06 Pranen

Try with a newer version please, it should work now.

cagataycivici avatar Mar 09 '17 09:03 cagataycivici

This issue is still active on version v10.1.2-lts

mcisseSafenergy avatar Jul 29 '21 13:07 mcisseSafenergy