Autocomplete: Resize menu on every suggestion.

This commit is contained in:
Scott González 2010-03-11 04:37:21 +00:00
parent 493e0395c1
commit c2ed8ffc07

View File

@ -246,9 +246,10 @@ $.widget( "ui.autocomplete", {
of: this.element, of: this.element,
collision: "none" collision: "none"
}); });
if ( ul.width() <= this.element.width() ) {
ul.width( this.element.width() ); var menuWidth = ul.width( "" ).width(),
} textWidth = this.element.width();
ul.width( Math.max( menuWidth, textWidth ) );
}, },
_renderMenu: function( ul, items ) { _renderMenu: function( ul, items ) {