Skip to content

Commit

Permalink
Merge pull request select2#1846 from tpruvot/master
Browse files Browse the repository at this point in the history
issue select2#1778: prevent delayed focus when the list is hidden
  • Loading branch information
ivaynberg committed Nov 7, 2013
2 parents 261dad0 + b757fb9 commit fc4bbbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,9 @@ the specific language governing permissions and limitations under the Apache Lic
// without this the search field loses focus which is annoying
if (document.activeElement === this.body().get(0)) {
window.setTimeout(this.bind(function() {
this.search.focus();
if (this.opened()) {
this.search.focus();
}
}), 0);
}
}));
Expand Down

0 comments on commit fc4bbbb

Please sign in to comment.