From: Scott González Date: Fri, 16 Jul 2010 18:12:06 +0000 (-0400) Subject: Autocomplete: Use .outerWidth() for determining the size of the menu. Fixes #5832... X-Git-Tag: 1.8.3~38^2~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=325a262b14aa41be9bda584d770eedbde47297b6;p=jquery-ui.git Autocomplete: Use .outerWidth() for determining the size of the menu. Fixes #5832 - Autocomplete: menu has incorrect width. --- diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 1a51baa8d..3fa196ecb 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -276,9 +276,13 @@ $.widget( "ui.autocomplete", { collision: "none" }); - menuWidth = ul.width( "" ).width(); - textWidth = this.element.width(); - ul.width( Math.max( menuWidth, textWidth ) ); + menuWidth = ul.width( "" ).outerWidth(); + textWidth = this.element.outerWidth(); + ul.width( Math.max( menuWidth, textWidth ) + - ( parseFloat( ul.css("paddingLeft") ) || 0 ) + - ( parseFloat( ul.css("paddingRight") ) || 0 ) + - ( parseFloat( ul.css("borderLeftWidth") ) || 0 ) + - ( parseFloat( ul.css("borderRightWidth") ) || 0 ) ); }, _renderMenu: function( ul, items ) {