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

Fix: PanelMenu(15403) - Submenu displays angledownicon when submenu is collapsed #16790

Merged

Conversation

mark7p
Copy link
Contributor

@mark7p mark7p commented Nov 20, 2024

Resolves #15403

Problem:: The logic from ngOnChanges() forces the component to create new processedItems with expanded: undefined.

Solution: Added check to keep expanded properties.

This is a possible solution for #16781 too, but I created another PR(#16791) with the fix for the hide animation.

Copy link

vercel bot commented Nov 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 10:43am

Copy link

vercel bot commented Nov 20, 2024

@mark7p is attempting to deploy a commit to the primetek Team on Vercel.

A member of the Team first needs to authorize it.

@mark7p mark7p marked this pull request as draft November 20, 2024 10:40
@mark7p mark7p marked this pull request as ready for review November 20, 2024 10:46
@mertsincan mertsincan added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 21, 2024
@mertsincan mertsincan merged commit b51a27f into primefaces:master Dec 6, 2024
4 of 5 checks passed
@mark7p mark7p deleted the fix/16781-panelmenu-submenu-expand-bug branch December 6, 2024 23:31
@josefKiefer
Copy link

@mark7p, I believe this is still an issue. I upgraded my app to use 17.18.13 and it still shows the down icon when the submenu is collapsed. Please let me know if I should open a new issue and thank you for your work on this.

@mark7p
Copy link
Contributor Author

mark7p commented Dec 13, 2024

Hi @josefKiefer , as for your issue #16781, the reason that the down icon still shows is because the submenu should retain its expanded state once its parent is opened again. If you toggled the submenu (labelled "New") open, then toggled another top level menu ("Calendar") open, instead of the submenu ("New") collapsing, its parent menu ("Users") will collapse -- considered that the property multiple is not enabled.

I have tested it with the latest v17.18.13 https://v17.primeng.org/panelmenu#controlled on Chrome and Firefox and it behaves as it should following the steps you mentioned here:

Click Users > New > Member
Click another top level menu (such as Calendar)
Click Users again and see that the New submenu is using the angledownicon instead of the anglerighticon. In addition, when >clicking on the New submenu, there is no animation to open it up.

2024-12-13 14-15-44

The actual bug on #16781 is that the submenu doesn't show its children when in expanded state. The angle down icon shows its right state, but the panel refuses to expand. I believe you misunderstood the right behavior of submenu because of this. Here is the expected behavior you provided:

Expected behavior

1. The chevron should be pointed to the right, indicating the submenu item is collapsed.
2. Clicking that submenu item should expand it with an animation.
3. When all other submenu items collapse, they should have an animation just like the top-level menu items have.

The first point in your Expected Behavior should be 1. The chevron should still be pointed down - indicating the submenu item is expanded and the children are visible.

You can observe this submenu behavior throughout the PrimeTek UI Suites https://v3.primevue.org/panelmenu/ https://primereact.org/panelmenu/ although by default, they are using multiple = true.

If I'm missing something regarding your issue, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PanelMenu nested subitems no longer get the expanded prop
3 participants