diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-03-11 04:37:21 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-03-11 04:37:21 +0000 |
commit | c2ed8ffc07903855d67c8a446beeedff96fb5af6 (patch) | |
tree | c66617785b75eab0571ffe8ef80e2467812fcf1d /ui/jquery.ui.autocomplete.js | |
parent | 493e0395c12065ad22132a34c7e2a72723c75cd1 (diff) | |
download | jquery-ui-c2ed8ffc07903855d67c8a446beeedff96fb5af6.tar.gz jquery-ui-c2ed8ffc07903855d67c8a446beeedff96fb5af6.zip |
Autocomplete: Resize menu on every suggestion.
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 7 |
1 files 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 ) { |