primefaces / primefaces/primereact

PanelMenu: expanded property doesn't work on the top list item

Open
#7,413 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

For the uncontrolled state, when PanelMenu's model.expanded property is set to true, the top list item is still collapsed.

For the nested list it works as expected (after opening the parent item)

image

Reproducer

https://stackblitz.com/edit/kp7quq?file=src%2FApp.jsx

System Information
System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz 
    Memory: 13.05 GB / 31.93 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\NodeJS 20.10.0\node.EXE
    npm: 10.2.3 - C:\Program Files\NodeJS 20.10.0\npm.CMD   
  Browsers:
    Edge: Chromium (130.0.2849.52)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    primereact: ^10.8.4 => 10.8.4 
    react: ^18.2.0 => 18.2.0
Steps to reproduce the behavior
  1. Go to https://stackblitz.com/edit/kp7quq?file=src%2FApp.jsx
  2. See the result. The highlighted expanded property is set to true while the component doesn't reflect it
Expected behavior

The PanelMenu component renders the expanded state for the items that has the expanded property set to true

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the PanelMenu implementation and the App.jsx reproducer linked in StackBlitz. Reproduce the uncontrolled case with a top-level item whose model.expanded property is true, then verify that the top item renders expanded while nested items continue to work as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.