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

PanelMenu collapses on clicking the menu link instead of being in expanded state #1011

Closed
jjayaraman opened this issue Sep 10, 2019 · 2 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@jjayaraman
Copy link

jjayaraman commented Sep 10, 2019

PrimeReact 'PanelMenu' collapse on clicking the menu link.
How to keep the selected menu expanded?
"Maybe an 'expand' property needed in MenuModel"?

Reference: https://forum.primefaces.org/posting.php?mode=edit&f=57&p=177399

Here is my code. Thanks

import React, { Component } from 'react'

import { PanelMenu } from 'primereact/panelmenu';


export default class Menu extends Component {

   constructor() {
      super();
      this.state = {
         items: [
            {
               label: 'Admin',
               icon: 'pi pi-fw pi-cog',
               items: [
                  {
                     label: 'Price Parameters',
                     icon: 'pi pi-fw pi-dollar',
                     items: [
                        {
                           label: 'Create',
                           icon: 'pi pi-fw pi-plus',
                           url: '/admin/price-parameter/create'
                        },
                        {
                           label: 'Search',
                           icon: 'pi pi-fw pi-search',
                           url: '/admin/price-parameter/search'
                        }
                     ]
                  }
               ]
            }
         ]
      }
   }

   render() {



      return (
         <div id="leftMenu">
            <PanelMenu model={this.state.items} style={{ fontSize: '12px' }} />
         </div>
      )
   }
}
@atigm
Copy link

atigm commented Jan 19, 2021

Hi,

I have about the same problem.
I use PanelMenu with a Sidebar, when I click on sidebar I lose PanelMenu state.

Any update please ?

Thank you

@mertsincan mertsincan added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Feb 9, 2021
@mertsincan mertsincan added this to the 6.1.0 milestone Feb 9, 2021
@mertsincan mertsincan changed the title PrimeReact 'PanelMenu' collapses on clicking the menu link instead of being in expanded state PanelMenu collapses on clicking the menu link instead of being in expanded state Mar 5, 2021
@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Mar 5, 2021
@mertsincan mertsincan self-assigned this Mar 5, 2021
@mertsincan
Copy link
Member

Hi,

Added 'expanded' option to MenuModel. You can use it.

Best Regards,

mertsincan added a commit that referenced this issue Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

3 participants