From c2ed8ffc07903855d67c8a446beeedff96fb5af6 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 11 Mar 2010 04:37:21 +0000 Subject: Autocomplete: Resize menu on every suggestion. --- ui/jquery.ui.autocomplete.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ui') 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 ) { -- cgit v1.2.3