Skip to content

Commit

Permalink
fix: Bug where you can't initialize sumo with multiple options select…
Browse files Browse the repository at this point in the history
…ed. Fixes #306
  • Loading branch information
Zenoo committed Jul 5, 2021
1 parent f83c37b commit 1691d71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.sumoselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@

createElems () {
const O = this;
const {0: {selectedIndex}} = O.E;
const {0: {selectedOptions}} = O.E;
O.E.wrap('<div class="SumoSelect" tabindex="0" role="button" aria-expanded="false">');
O.E[0].selectedIndex = selectedIndex; // Fix for IE resetting index to 0 when -1
O.E[0].selectedOptions = selectedOptions; // Fix for IE resetting index to 0 when -1
O.select = O.E.parent();
O.caption = $('<span>');
O.CaptionCont = $(`<p class="CaptionCont SelectBox ${O.E.attr('class')}" ><label><i></i></label></p>`)
Expand Down

0 comments on commit 1691d71

Please sign in to comment.