From: Scott González Date: Thu, 11 Mar 2010 04:37:21 +0000 (+0000) Subject: Autocomplete: Resize menu on every suggestion. X-Git-Tag: 1.8~57 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c2ed8ffc07903855d67c8a446beeedff96fb5af6;p=jquery-ui.git Autocomplete: Resize menu on every suggestion. --- diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 3cb031b1e..8e46a00e8 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -246,9 +246,10 @@ $.widget( "ui.autocomplete", { of: this.element, 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 ) {