Skip to content

Commit beb9019

Browse files
committed
Autocomplete: Implement new _addClass api
1 parent 105a271 commit beb9019

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

ui/autocomplete.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ $.widget( "ui.autocomplete", {
213213
.hide()
214214
.menu( "instance" );
215215

216-
this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
216+
this._addClass( this.menu.element, "ui-autocomplete ui-front" );
217217
this._on( this.menu.element, {
218218
mousedown: function( event ) {
219219
// prevent moving focus out of the text field
@@ -309,9 +309,8 @@ $.widget( "ui.autocomplete", {
309309
role: "status",
310310
"aria-live": "assertive",
311311
"aria-relevant": "additions"
312-
})
313-
.addClass( "ui-helper-hidden-accessible" )
314-
.appendTo( this.document[ 0 ].body );
312+
}).appendTo( this.document[ 0 ].body );
313+
this._addClass( this.liveRegion, "ui-helper-hidden-accessible" );
315314

316315
// turning off autocomplete prevents the browser from remembering the
317316
// value when navigating through history, so we re-enable autocomplete
@@ -325,9 +324,7 @@ $.widget( "ui.autocomplete", {
325324

326325
_destroy: function() {
327326
clearTimeout( this.searching );
328-
this.element
329-
.removeClass( "ui-autocomplete-input" )
330-
.removeAttr( "autocomplete" );
327+
this.element.removeAttr( "autocomplete" );
331328
this.menu.element.remove();
332329
this.liveRegion.remove();
333330
},

0 commit comments

Comments
 (0)