|
@@ -773,7 +773,8 @@ S2.define('select2/results',[
|
|
|
this.hideLoading();
|
|
|
|
|
|
var $message = $(
|
|
|
- '<li role="treeitem" class="select2-results__option"></li>'
|
|
|
+ '<li role="treeitem" aria-live="assertive"' +
|
|
|
+ ' class="select2-results__option"></li>'
|
|
|
);
|
|
|
|
|
|
var message = this.options.get('translations').get(params.message);
|
|
@@ -1236,7 +1237,7 @@ S2.define('select2/results',[
|
|
|
var template = this.options.get('templateResult');
|
|
|
var escapeMarkup = this.options.get('escapeMarkup');
|
|
|
|
|
|
- var content = template(result);
|
|
|
+ var content = template(result, container);
|
|
|
|
|
|
if (content == null) {
|
|
|
container.style.display = 'none';
|
|
@@ -1293,7 +1294,7 @@ S2.define('select2/selection/base',[
|
|
|
BaseSelection.prototype.render = function () {
|
|
|
var $selection = $(
|
|
|
'<span class="select2-selection" role="combobox" ' +
|
|
|
- 'aria-autocomplete="list" aria-haspopup="true" aria-expanded="false">' +
|
|
|
+ ' aria-haspopup="true" aria-expanded="false">' +
|
|
|
'</span>'
|
|
|
);
|
|
|
|
|
@@ -1801,7 +1802,7 @@ S2.define('select2/selection/search',[
|
|
|
'<li class="select2-search select2-search--inline">' +
|
|
|
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
|
|
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
|
|
- ' spellcheck="false" role="textbox" />' +
|
|
|
+ ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
|
|
'</li>'
|
|
|
);
|
|
|
|
|
@@ -1826,6 +1827,7 @@ S2.define('select2/selection/search',[
|
|
|
|
|
|
container.on('close', function () {
|
|
|
self.$search.val('');
|
|
|
+ self.$search.removeAttr('aria-activedescendant');
|
|
|
self.$search.trigger('focus');
|
|
|
});
|
|
|
|
|
@@ -1843,6 +1845,10 @@ S2.define('select2/selection/search',[
|
|
|
self.$search.trigger('focus');
|
|
|
});
|
|
|
|
|
|
+ container.on('results:focus', function (params) {
|
|
|
+ self.$search.attr('aria-activedescendant', params.id);
|
|
|
+ });
|
|
|
+
|
|
|
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
|
|
self.trigger('focus', evt);
|
|
|
});
|
|
@@ -1982,9 +1988,8 @@ S2.define('select2/selection/search',[
|
|
|
data: item
|
|
|
});
|
|
|
|
|
|
- this.trigger('open', {});
|
|
|
-
|
|
|
- this.$search.val(item.text + ' ');
|
|
|
+ this.$search.val(item.text);
|
|
|
+ this.handleSearch();
|
|
|
};
|
|
|
|
|
|
Search.prototype.resizeSearch = function () {
|
|
@@ -4109,7 +4114,8 @@ S2.define('select2/dropdown/attachBody',[
|
|
|
this.$dropdownContainer.detach();
|
|
|
};
|
|
|
|
|
|
- AttachBody.prototype._attachPositioningHandler = function (container) {
|
|
|
+ AttachBody.prototype._attachPositioningHandler =
|
|
|
+ function (decorated, container) {
|
|
|
var self = this;
|
|
|
|
|
|
var scrollEvent = 'scroll.select2.' + container.id;
|
|
@@ -4136,7 +4142,8 @@ S2.define('select2/dropdown/attachBody',[
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- AttachBody.prototype._detachPositioningHandler = function (container) {
|
|
|
+ AttachBody.prototype._detachPositioningHandler =
|
|
|
+ function (decorated, container) {
|
|
|
var scrollEvent = 'scroll.select2.' + container.id;
|
|
|
var resizeEvent = 'resize.select2.' + container.id;
|
|
|
var orientationEvent = 'orientationchange.select2.' + container.id;
|