Skip to content

Commit

Permalink
Fix style when using escape key with data-container
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed May 11, 2015
1 parent 97ae95b commit e036e01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@
if (/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && that.$menu.find('.active').length === 0) {
e.preventDefault();
that.$menu.parent().removeClass('open');
if (that.options.container) that.$newElement.removeClass('open');
that.$button.focus();
}
// $items contains li elements when liveSearch is enabled
Expand Down Expand Up @@ -1356,6 +1357,7 @@

if ((/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode.toString(10)) && !isActive)) {
that.$menu.parent().removeClass('open');
if (that.options.container) that.$newElement.removeClass('open');
that.$button.focus();
}
},
Expand Down

0 comments on commit e036e01

Please sign in to comment.