Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#5411 closed enhancement (duplicate)

Scrolling of Autocomplete menu

Reported by: theojapa Owned by:
Priority: minor Milestone:
Component: ui.autocomplete Version: 1.8
Keywords: Cc:
Blocked by: Blocking:

Description

It'd be useful to be able to specify the maximum height of the Autocomplete menu. If necessary, the Autocomplete menu would scroll.

This would allow Autocomplete to work well when there's not much space for the Autocomplete menu below the Autocomplete component.

Attachments (2)

autocomplete_limit_rows.patch (4.4 KB) - added by Ascold 9 years ago.
Try this patch to use autocomplete with limited count of rows. May be, in future, it will be modified for scroll.
autocomplete_limit_rows.2.patch (4.4 KB) - added by chris 9 years ago.
fixed bug (wrong variable incremented in original patch)

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by Ascold

Try this patch to use autocomplete with limited count of rows. May be, in future, it will be modified for scroll.

comment:1 Changed 9 years ago by chris

Hi there,

There seems to be an error in this patch. I got it to work by inserting the following two code bits (delimited by /*patch0*/ and /*patch1*/ respectively) into the original code:

_renderMenu:function(a,c){var d=this;/*patch0*/var j=0;var m=this.options.maxRows;/*patch0*/e.each(c,function(b,f){/*patch1*/if(m&&m<=j){return false;}++j;/*patch1*/d._renderItem(a,f)})},_renderItem:function(a,c){

The mistake was that in stead of incrementing with "++j" the original patch incremented with "++m". Also, I changed "m&&m<j" to "m&&m<=j"

Thanks for a great patch. Would never have gotten it to work without you!

p.s. I guess I should be uploading a .patch file. I hope you'll forgive me for leaving it at this explanation.

Changed 9 years ago by chris

fixed bug (wrong variable incremented in original patch)

comment:2 Changed 9 years ago by Jörn Zaefferer

Please provide patches against files on Github: http://github.com/jquery/jquery-ui

We can't use patches against minified files from a release.

comment:3 Changed 9 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #5610.

comment:4 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.