Skip to content

Commit

Permalink
fixes select2#3663
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-Olof Kreim committed Aug 31, 2018
1 parent d1a5715 commit caeb650
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
3 changes: 3 additions & 0 deletions dist/js/i18n/sq.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions dist/js/select2.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,13 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');

self.$selection.focus();
// Only focus if preCloseFocus and afterCloseFocus are the same
// (selection or closing by keyboard)
var preCloseFocus = window.document.activeElement;
window.setTimeout(function () {
self.$selection.focus();
if(preCloseFocus === window.document.activeElement) {
self.$selection.focus();
}
}, 0);

self._detachCloseHandler(container);
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.full.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions dist/js/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,13 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');

self.$selection.focus();
// Only focus if preCloseFocus and afterCloseFocus are the same
// (selection or closing by keyboard)
var preCloseFocus = window.document.activeElement;
window.setTimeout(function () {
self.$selection.focus();
if(preCloseFocus === window.document.activeElement) {
self.$selection.focus();
}
}, 0);

self._detachCloseHandler(container);
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/js/select2/selection/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ define([
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');

self.$selection.focus();
// Only focus if preCloseFocus and afterCloseFocus are the same
// (selection or closing by keyboard)
var preCloseFocus = window.document.activeElement;
window.setTimeout(function () {
self.$selection.focus();
if(preCloseFocus === window.document.activeElement) {
self.$selection.focus();
}
}, 0);

self._detachCloseHandler(container);
Expand Down

0 comments on commit caeb650

Please sign in to comment.