primeng icon indicating copy to clipboard operation
primeng copied to clipboard

PanelMenu nested subitems no longer get the expanded prop

Open digitalcraftco opened this issue 1 year ago • 0 comments

Describe the bug

In previous version 16.x.x 2nd & 3rd level nested sub menu items also had an expanded prop in the model when toggled open. In versions 17.x.x they are no longer getting the expanded prop. Only the 1st level parent items.

This makes it impossible to persist the expanded state of the panel menu beyond the first level. On a page refresh the menu will be reset to it's original state and user loses context.

{
    expanded: true,
    label: "Admin",
    items: [
         { 
            expanded: true,   < --- ! Not added here anymore. Same with deeper levels
            label: "Tasks",
            items: [...]
        },
        ...
    ]
 }

Environment

Angular 18.0.1

Reproducer

Toggle the menu a few items deep. The model will update below. Notice no nested items get an expanded attribute. Only top level parents. If you manually add expanded attribute to nested child (Documents) it won't update either. Notice how Files changes from false to true.

https://stackblitz.com/edit/s5kubx-5x7cem?file=src%2Fapp%2Fpanel-menu-basic-demo.html

Angular version

18.0.1

PrimeNG version

17.18.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.9.0

Browser(s)

No response

Steps to reproduce the behavior

Toggle a panel menu with 3rd or 4th level items. Inspect the model and you will see the nested parent items do not have the expanded: true property.

Expected behavior

No response

digitalcraftco avatar Apr 29 '24 21:04 digitalcraftco