Skip to content

Commit 0275260

Browse files
committed
Autocomplete: Added WAI-ARIA live region support for screen-reader accessibility. Fixed #7840 - Autocomplete: popup results not read by screen-readers.
1 parent 427815e commit 0275260

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ $.widget( "ui.autocomplete", {
229229
self._value( item.value );
230230
}
231231
}
232-
self.liveRegion.html(item.value);
232+
self.liveRegion.text(item.value);
233233
},
234234
select: function( event, ui ) {
235235
var item = ui.item.data( "item.autocomplete" ),
@@ -397,7 +397,7 @@ $.widget( "ui.autocomplete", {
397397
close: function( event ) {
398398
clearTimeout( this.closing );
399399
if ( this.menu.element.is(":visible") ) {
400-
this.liveRegion.html("");
400+
this.liveRegion.text("");
401401
this.menu.element.hide();
402402
this.menu.blur();
403403
this._trigger( "close", event );
@@ -448,7 +448,7 @@ $.widget( "ui.autocomplete", {
448448
if ( this.options.autoFocus ) {
449449
this.menu.next( new $.Event("mouseover") );
450450
}
451-
this.liveRegion.html(this.options.accessiblePopupText);
451+
this.liveRegion.text(this.options.accessiblePopupText);
452452
},
453453

454454
_resizeMenu: function() {

0 commit comments

Comments
 (0)