-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Environment
- Package version(s): develop
- Browser and OS versions: Chrome 68.0.3440.75
Actual behavior
Current behaviour associated with the POPOVER_DISMISS
:
Popovers catch all click events bubbling and if the target of the event has a DISMISS_POPOVER class near it, this popover will close itself.
The issue I have with this behaviour can be seen in this example
Expected behavior
Clicking a menu item should close the menu, but not the main popover.
Possible solution
Currently we work around this issue by trapping the event with stopPropagation(), which can be seen here
As far as I can tell the main reason the behaviour is implemented like this is so clicking an item in a nested sub-menu will close all parent menus. if this is the case, wouldn't it make more sense for the Menu component to handle this internally somehow?
Would love to hear what other peoples thoughts are on this, or is simply trapping the event in user-land code good enough?