Skip to content

Commit

Permalink
fix: IE resetting selectedIndex from -1 to 0. Fixes #221
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenoo committed Jun 20, 2021
1 parent c56ea3b commit 8629388
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[
"@babel/preset-env",
{
"useBuiltIns": "entry"
"useBuiltIns": "entry",
"corejs": 2
}
],
"minify"
Expand Down
2 changes: 2 additions & 0 deletions jquery.sumoselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@

createElems: function () {
var O = this;
const selectedIndex = O.E[0].selectedIndex;
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.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 8629388

Please sign in to comment.