1
0
mirror of synced 2025-02-16 20:13:16 +03:00

PR for -> autofocus isn't supported #3696 (#5356)

* Update core.js

* Update core.js

* Update core.js
This commit is contained in:
Pedro Felipe de Azevedo Furtado 2018-09-11 15:28:59 -03:00 committed by GitHub
parent e15046e959
commit 2ea17181e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');