[Menu] closeOnSelect not working on navigation w/ next.js links
See original GitHub issueDescribe the bug
As shown above while selecting link which is wrapped in next/link
in MenuItem
, MenuList
isn’t closing automatically as it does for normal links or any items in menu list
Is there any workaround/way to close menu on dynamic links selection?
Expected Behavior It should automatically close on selection
To Reproduce
- Create menu links wrapped under
next/link
- Select any option
Suggested solution(s)
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context I think it’s happning due to next.js overtaking link component and preventing it on click so parent isn’t able to detact event
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Next js not closing mobile nav when click nav link
I'm using Next Js with Tailwind CSS for creating the website. Use Javascript to toggle the menu for Mobile devices. But Next Js...
Read more >Menu - Argon Dashboard Chakra - Creative Tim
An accessible dropdown menu for the common dropdown menu button design pattern. Menu uses roving tabIndex for focus management. Import#. Chakra UI exports...
Read more >Dropdown | Select2 - The jQuery replacement for select boxes
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and pagination (infinite scrolling) of results.
Read more >Menu - Chakra UI
Chakra UI exports 8 components for rendering menus: ... MenuItemOption : The checkable menu item, to be used with MenuOptionGroup . import {....
Read more >Dropdown | NextUI - Beautiful, fast and modern React UI Library
Menu . Dropdown.Section: A wrapper to group related menu items. ... important to have a unique key for each item, otherwise the disabled...
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
I had this issue, too, but solved it using the
onClose
property thatMenu
can pass to its children. For example:Seems related, I’m finding the menu isn’t closing when I click anything other than the menu itself?
https://codesandbox.io/s/exciting-moon-u64ey