#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)
Change History (6)
Changed 13 years ago by
Attachment: | autocomplete_limit_rows.patch added |
---|
comment:1 Changed 13 years ago by
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 13 years ago by
Attachment: | autocomplete_limit_rows.2.patch added |
---|
fixed bug (wrong variable incremented in original patch)
comment:2 Changed 13 years ago by
Please provide patches against files on Github: http://github.com/jquery/jquery-ui
We can't use patches against minified files from a release.
Try this patch to use autocomplete with limited count of rows. May be, in future, it will be modified for scroll.