When a child Menu.Item was selected, its parent SubMenu should be expanded
See original GitHub issueWhat problem does this feature solve?
Suppose we have a menu:
<Menu defaultSelectedKeys={['sub-1', 'sub-sub-1']}>
<Menu.SubMenu key='sub'>
<Menu.Item key='sub-1'>
</Menu.Item>
<Menu.SubMenu key='sub-sub'>
<Menu.Item key='sub-sub-1'>
</Menu.Item>
</Menu.SubMenu>
</Menu.SubMenu>
</Menu>
Since defaultSelectedKeys
is [‘sub-1’, ‘sub-sub-1’], the SubMenu sub
and sub-sub
should be automatically expanded.
What does the proposed API look like?
FYI
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (3 by maintainers)
Top Results From Across the Web
How to open/close antd Submenu programatically
What I'm trying to do is, I need to collapse/expand the SubMenu once it's enabled via the prop. Here is my code. I...
Read more >Menu - Ant Design
Your customized node should be wrapped by Menu.Item . Menu needs to collect its node structure, so its children should be Menu.* or...
Read more >Is there a way for menu parent “#” itself to expand submenu ...
I have users that click the parent name (which does nothing as I set to custom url “#” to be just a menu...
Read more >Keep submenu expanded when parent or children are active
I have a two-tiered menu system using the Nice menus module, which I've adapted to run horizontally with the children beneath the top...
Read more >Auto-expand parent menu item(s) for active menu item - Drupal
Then, Menu Item 1 and SubMenuItem1 should both have the "open" class ... If there are submenu items we assign the parent a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@afc163 why did you close the ticket? It seems like a useful feature, you can leave the default you prefer, but implementing this can be somewhat hard. Think about this scenario: you have a submenu called Users and under it “List”/“New” you would like that when you click “New” to change the route, and keep Users menu expanded, otherwise it results in weird behaviour.
Maybe another developer hits this and I save him 15-20 mins of his time: