Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes IE11 issue with select losing focus having selected an item. #4860

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/js/select2/i18n/nb.js
Expand Up @@ -12,9 +12,7 @@ define(function () {
inputTooShort: function (args) {
var remainingChars = args.minimum - args.input.length;

var message = 'Vennligst skriv inn ' + remainingChars + ' tegn til';

return message + ' tegn til';
return 'Vennligst skriv inn ' + remainingChars + ' tegn til';
},
loadingMore: function () {
return 'Laster flere resultater…';
Expand Down
3 changes: 3 additions & 0 deletions src/js/select2/selection/base.js
Expand Up @@ -82,6 +82,9 @@ define([
self.$selection.removeAttr('aria-owns');

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

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

this.resizeSearch();
if (searchHadFocus) {
this.$search.focus();
var isTagInput = this.$element.find('[data-select2-tag]').length;
if (isTagInput) {
// fix IE11 bug where tag input lost focus
this.$element.focus();
} else {
this.$search.focus();
}
}
};

Expand Down