Skip to content

Commit 885eda1

Browse files
committed
check if the menu was clicked outside a valid element, fixes dgoguerra#3
1 parent e39f769 commit 885eda1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/BootstrapMenu.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ function setupActionsEventListeners(_this) {
179179

180180
var $target = $(evt.target);
181181

182+
// either a divider or the menu (not an option inside it) was clicked,
183+
// don't do anything
184+
if ($target.is('.divider') || $target.is('.dropdown-menu')) {
185+
return;
186+
}
187+
182188
var $action = $target.is('[data-action]') ? $target : $target.closest('[data-action]');
183189
var actionId = $action.data('action');
184190

0 commit comments

Comments
 (0)