Skip to content

Commit

Permalink
Fixes #3917, adds check for bubbled label event coming from surroundi…
Browse files Browse the repository at this point in the history
…ng label
  • Loading branch information
jlukic committed May 15, 2016
1 parent a1e6012 commit 10e6752
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,9 @@ $.fn.dropdown = function(parameters) {
? module.show
: module.toggle
;
if(module.is.bubbledLabelClick(event)) {
return;
}
if( module.determine.eventOnElement(event, toggleBehavior) ) {
event.preventDefault();
}
Expand Down Expand Up @@ -2920,6 +2923,9 @@ $.fn.dropdown = function(parameters) {
active: function() {
return $module.hasClass(className.active);
},
bubbledLabelClick: function(event) {
return $(event.target).is('select, input') && $module.closest('label').length > 0;
},
alreadySetup: function() {
return ($module.is('select') && $module.parent(selector.dropdown).length > 0 && $module.prev().length === 0);
},
Expand Down

0 comments on commit 10e6752

Please sign in to comment.