Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jonnomk opened this issue Sep 13, 2022 · 2 comments · Fixed by #11970
Closed

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

jonnomk opened this issue Sep 13, 2022 · 2 comments · Fixed by #11970
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@jonnomk
Copy link

jonnomk commented Sep 13, 2022

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 jonnomk changed the title MenuItem visible property not working MenuItem visible property not working in Menu with sub items. Sep 13, 2022
@jonnomk jonnomk changed the title MenuItem visible property not working in Menu with sub items. MenuItem visible property not working in Menu <p-menu> with sub items. Sep 14, 2022
@cetincakiroglu
Copy link
Contributor

Hi,

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

Regards

@cetincakiroglu cetincakiroglu added the Resolution: Cannot Replicate Issue could not be replicated by Core Team label Sep 15, 2022
@jonnomk
Copy link
Author

jonnomk commented Sep 15, 2022

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.

@cetincakiroglu cetincakiroglu added this to the 14.1.2 milestone Sep 16, 2022
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Resolution: Cannot Replicate Issue could not be replicated by Core Team labels Sep 16, 2022
cetincakiroglu added a commit that referenced this issue Sep 23, 2022
Fixed #11928 - MenuItem visible property not working in Menu <p-menu>…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants