]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Use .outerWidth() for determining the size of the menu. Fixes #5832...
authorScott González <scott.gonzalez@gmail.com>
Fri, 16 Jul 2010 18:12:06 +0000 (14:12 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 16 Jul 2010 18:12:06 +0000 (14:12 -0400)
ui/jquery.ui.autocomplete.js

index 1a51baa8dc1dd20d97e0213e8a3aa93f72f38936..3fa196ecb6af42328e6b4ae224767b5a99da9693 100644 (file)
@@ -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 ) {