Skip to content

Commit

Permalink
fixed bug that submitted form on dropdown click
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Morey committed May 14, 2015
1 parent 34df261 commit 008b637
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# MUI Changelog

## 0.1.2 -

* Fixed bug to prevent form submission on dropdown click

## 0.1.1 - May 10, 2015

* Removed bower dependencies
Expand Down
10 changes: 6 additions & 4 deletions dist/js/mui.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ function clickHandler(ev) {
// exit if toggle button is disabled
if (toggleEl.getAttribute('disabled') !== null) return;

// let event bubble before toggling dropdown
setTimeout(function() {
if (!ev.defaultPrevented) toggleDropdown(toggleEl);
}, 0);
// prevent form submission
ev.preventDefault();
ev.stopPropagation();

// toggle dropdown
toggleDropdown(toggleEl);
}


Expand Down

0 comments on commit 008b637

Please sign in to comment.