Skip to content

Commit

Permalink
fix(Dropdown): added option to enable event bubbeling on click
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Jun 20, 2016
1 parent 626f248 commit 06a2d41
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ const ATTR_CC = 'data-collision-container';
* @type {string}
*/
const ATTR_DARKENER = 'data-darkener-container';
/**
* @type {string}
*/
const ATTR_ENABLE_EVENT_BUBBLE = 'data-enable-event-bubble';
/**
* @type {string}
*/
Expand Down Expand Up @@ -127,8 +131,11 @@ class Dropdown {
}

if (target && !currentOpen) {
e.preventDefault();
e.stopImmediatePropagation();

if (!target.getAttribute(ATTR_ENABLE_EVENT_BUBBLE)) {
e.preventDefault();
e.stopImmediatePropagation();
}

if (target.isLoading) {
return false;
Expand Down

0 comments on commit 06a2d41

Please sign in to comment.