Skip to content

Commit

Permalink
PR for -> autofocus isn't supported #3696 (#5356)
Browse files Browse the repository at this point in the history
* Update core.js

* Update core.js

* Update core.js
  • Loading branch information
pedrofurtado committed Sep 11, 2018
1 parent e15046e commit 2ea1718
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/js/select2/core.js
Expand Up @@ -276,6 +276,23 @@ define([

Select2.prototype._registerEvents = function () {
var self = this;

this.on('focus', function () {
self.$container.addClass('select2-container--focus');

if (!self.$container.hasClass('select2-container--disabled') &&
!self.isOpen()) {
if (self.options.get('multiple')) {
window.setTimeout(function () {
self.open();
},
self.options.get('ajax') ? 300 : 100);
}
else {
self.open();
}
}
});

this.on('open', function () {
self.$container.addClass('select2-container--open');
Expand Down

0 comments on commit 2ea1718

Please sign in to comment.