primeng
primeng copied to clipboard
popup-menu doesn't propagate clicks with menu-structure that was generate by function
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
Try with a newer version please, it should work now.
This issue is still active on version v10.1.2-lts