Skip to content

Commit c2ed8ff

Browse files
committed
Autocomplete: Resize menu on every suggestion.
1 parent 493e039 commit c2ed8ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,10 @@ $.widget( "ui.autocomplete", {
246246
of: this.element,
247247
collision: "none"
248248
});
249-
if ( ul.width() <= this.element.width() ) {
250-
ul.width( this.element.width() );
251-
}
249+
250+
var menuWidth = ul.width( "" ).width(),
251+
textWidth = this.element.width();
252+
ul.width( Math.max( menuWidth, textWidth ) );
252253
},
253254

254255
_renderMenu: function( ul, items ) {

0 commit comments

Comments
 (0)