Permalink
Browse files

Merge pull request #30 from arielbottero/patch-2

jquery.dropdown.js
2 parents 046b566 + a08df5c commit 9d366441e38086d9e67b2348eb690832119e282c @FezVrasta committed Nov 13, 2015
Showing with 4 additions and 1 deletion.
  1. +4 −1 jquery.dropdown.js
View
@@ -297,7 +297,9 @@
// Behavior for single select
if (!multi) {
// Unselect options except the one that will be selected
- selectOptions.not($target).removeClass("selected");
+ if ($target.is("li")) {
+ selectOptions.not($target).removeClass("selected");
+ }
// Select the selected option
$target.addClass("selected");
// Set the value to the native select
@@ -351,6 +353,7 @@
// Ss it selected?
if ($this.prop("selected")) {
$option.attr("selected", true);
+ $option.addClass("selected");
}
// Append option to our dropdown

0 comments on commit 9d36644

Please sign in to comment.