Skip to content

Commit

Permalink
fix(dropdown): only preventdefault on hide for associating labels
Browse files Browse the repository at this point in the history
The implemented preventDefault avoided a dropdown by reopening when clicking on the associated label instead of the dropdown itself.
Unfortunately this also stops other events in some situations which do not belong to the dropdown itself.
This PR now only prevents the event when the special case of the associated label was the target.

Closes #861
  • Loading branch information
lubber-de authored and Sean committed Jul 25, 2019
1 parent 31d80d2 commit 568858c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,9 @@ $.fn.dropdown = function(parameters) {
},
hide: function(event) {
if(module.determine.eventInModule(event, module.hide)){
if(element.id && $(event.target).attr('for') === element.id){
event.preventDefault();
}
}
}
},
Expand Down

0 comments on commit 568858c

Please sign in to comment.