question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support closeOnOutsideClick for nested menus

See original GitHub issue

Is 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?

Screenshot 2020-01-22 at 09 40 50

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
everweijcommented, Feb 10, 2020

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.

0reactions
everweijcommented, Feb 13, 2020

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 👍🏼

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found