Autocomplete: Use .outerWidth() for determining the size of the menu. Fixes #5832 - Autocomplete: menu has incorrect width.

This commit is contained in:
Scott González 2010-07-16 14:12:06 -04:00
parent ba749ba683
commit 325a262b14

View File

@ -276,9 +276,13 @@ $.widget( "ui.autocomplete", {
collision: "none" collision: "none"
}); });
menuWidth = ul.width( "" ).width(); menuWidth = ul.width( "" ).outerWidth();
textWidth = this.element.width(); textWidth = this.element.outerWidth();
ul.width( Math.max( menuWidth, textWidth ) ); 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 ) { _renderMenu: function( ul, items ) {