Support closeOnOutsideClick for nested menus
See original GitHub issueIs it possible to make the closeOnOutsideClick
setting work for nested popovers/menus?
I.e. if I have a nested menu, it should close when I click outside all of the menu layers, but not close the entire menu if I click inside a child layer (as it currently does).
If not, is there any workaround I can use?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
How can I close a dropdown on click outside? - Stack Overflow
I would like to close my login menu dropdown when the user click anywhere ... Just keep an eye for browser compatibility, .closest()...
Read more >react-dd-menu - npm
Start using react-dd-menu in your project by running `npm i react-dd-menu`. ... Added Touch/click support for nested menus.
Read more >JavaScript Context Menu Configuration - DevExtreme
An object defining configuration options for the ContextMenu widget. accessKey. Specifies the shortcut key that sets focus on the widget.
Read more >Set up drop-down menus in your online store
You can nest menus and menu items into drop-downs to help you structure ... in the main menu on your online store, and...
Read more >Adding drop-down menus to your navigation with folders
Use folders to create drop-down navigation menus (also known as nested pages or sub-menus) on your site. Each folder creates a single...
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
Thanks @mtmacdonald for looking into this, very helpful 👍🏼 I will try some things out tomorrow. Will let you know where I will come up with.
Hi @mtmacdonald, Good to hear you managed to get it to work!
I agree it’s a tricky area to solve -> managing layers in a group setting. I think that in the future there should be some kind of mechanism which handles open / close behavior of these kind of related toggle-layers (like nested menu’s). Right now, I think I rather put this logic inside an own hook or component, because I want to limit the complexity and responsibilities that ToggleLayer / useToggleLayer currently has.
Thanks for sharing your code, helpful stuff 👍🏼