From c2ed8ffc07903855d67c8a446beeedff96fb5af6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 11 Mar 2010 04:37:21 +0000 Subject: [PATCH] Autocomplete: Resize menu on every suggestion. --- ui/jquery.ui.autocomplete.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 ) { -- 2.39.5