Skip to content

Commit c3f8177

Browse files
Gabriel Schulhofarschmitz
authored andcommitted
Autocomplete: Implement _elementsFromFromClassKey()
1 parent b607b77 commit c3f8177

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ui/autocomplete.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,26 @@ $.widget( "ui.autocomplete", {
334334
this.liveRegion.remove();
335335
},
336336

337+
_elementsFromClassKey: function( classKey ) {
338+
switch( classKey ) {
339+
case "ui-autocomplete":
340+
return this.menu.element;
341+
case "ui-autocomplete-input":
342+
return this.element;
343+
344+
// If the following class is not present on the widget, we chain up.
345+
case "ui-autocomplete-loading":
346+
if ( this.element.hasClass( "ui-autocomplete-loading" ) ) {
347+
return this.element;
348+
}
349+
break;
350+
default:
351+
break;
352+
}
353+
354+
return this._superApply( arguments );
355+
},
356+
337357
_setOption: function( key, value ) {
338358
this._super( key, value );
339359
if ( key === "source" ) {

0 commit comments

Comments
 (0)