Skip to content

Commit

Permalink
Enhanced selected option detection to fix default title in IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
TwanVermeulen committed May 31, 2015
1 parent 7a26e57 commit 466d925
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
titleOption.value = '';
element.insertBefore(titleOption, element.firstChild);
// Check if selected attribute is already set on an option. If not, select the titleOption option.
if (element.options[element.selectedIndex].getAttribute('selected') === null) titleOption.selected = true;
if ($(element.options[element.selectedIndex]).attr('selected') === undefined) titleOption.selected = true;
}
}

Expand Down

0 comments on commit 466d925

Please sign in to comment.