Skip to content

Commit

Permalink
Remove deprecated jQuery shorthand (#5564)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-j-morse authored and kevin-brown committed Jul 20, 2019
1 parent 9c4f0c8 commit 8a5aeab
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/js/select2/data/tokenizer.js
Expand Up @@ -58,7 +58,7 @@ define([
// Replace the search term if we have the search box
if (this.$search.length) {
this.$search.val(tokenData.term);
this.$search.focus();
this.$search.trigger('focus');
}

params.term = tokenData.term;
Expand Down
8 changes: 4 additions & 4 deletions src/js/select2/dropdown/search.js
Expand Up @@ -49,23 +49,23 @@ define([
container.on('open', function () {
self.$search.attr('tabindex', 0);

self.$search.focus();
self.$search.trigger('focus');

window.setTimeout(function () {
self.$search.focus();
self.$search.trigger('focus');
}, 0);
});

container.on('close', function () {
self.$search.attr('tabindex', -1);

self.$search.val('');
self.$search.blur();
self.$search.trigger('blur');
});

container.on('focus', function () {
if (!container.isOpen()) {
self.$search.focus();
self.$search.trigger('focus');
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/js/select2/selection/base.js
Expand Up @@ -82,7 +82,7 @@ define([
self.$selection.removeAttr('aria-owns');

window.setTimeout(function () {
self.$selection.focus();
self.$selection.trigger('focus');
}, 0);

self._detachCloseHandler(container);
Expand Down
2 changes: 1 addition & 1 deletion src/js/select2/selection/search.js
Expand Up @@ -175,7 +175,7 @@ define([

this.resizeSearch();
if (searchHadFocus) {
this.$search.focus();
this.$search.trigger('focus');
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/js/select2/selection/single.js
Expand Up @@ -59,7 +59,7 @@ define([

container.on('focus', function (evt) {
if (!container.isOpen()) {
self.$selection.focus();
self.$selection.trigger('focus');
}
});
};
Expand Down

0 comments on commit 8a5aeab

Please sign in to comment.