primeng icon indicating copy to clipboard operation
primeng copied to clipboard

MenuItem visible property not working in Menu <p-menu> with sub items.

Open jonnomk opened this issue 2 years ago • 2 comments

Describe the bug If you set visible to false for a parent MenuItem when there are children, the children are hidden, but the parent is not.

Environment Windows 11

Angular version 14.2.1

PrimeNG version 14.0.2

Build / Runtime Angular CLI App

Node version 14.17.0

Browser(s) Chrome 105.0.5195.102

Steps to reproduce Using the below model for menu with sub items:

image

...results in the below output.

image

Expected behaviour The parent AND it's children should not be even rendered to the DOM, let alone hidden.

StackBlitz https://stackblitz.com/edit/primeng-menu-visible-issue

jonnomk avatar Sep 13 '22 13:09 jonnomk

Hi,

Cannot replicate the issue could you please provide a Stackblitz example by using https://stackblitz.com/github/primefaces/primeng-issue-template

Regards

cetincakiroglu avatar Sep 15 '22 09:09 cetincakiroglu

Hi,

Cannot replicate the issue could you please provide a Stackblitz example by using https://stackblitz.com/github/primefaces/primeng-issue-template

Regards

Hi @cetincakiroglu

Yes - here is a StackBlitz. Did you test using PrimeNG 14.0.2?

https://stackblitz.com/edit/primeng-menu-visible-issue

I think also, the items that are not visible should not be rendered to the DOM.

jonnomk avatar Sep 15 '22 09:09 jonnomk