Wrong selector for :selected #20

Open
ArtyomZakharov opened this Issue Jun 30, 2015 · 0 comments

Projects

None yet

1 participant

Condition in source code is always false because selector :selected works only with <option> tags and doesn't work with generated <li selected="selected">.

if ($ul.find(":selected").length) {
   ...
} else {
 ...
}

It should be changed to $ul.find('li[selected]') or you should change attribute to data-selected and condition to $ul.find('li[data-selected]') which is much better esthetically, because selected="selected"should be used only for <option> tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment