Opened 10 years ago

Closed 10 years ago

#9056 closed bug (invalid)

Autocomplete: Menu resizing should respect position.of option

Reported by: xinix00 Owned by: xinix00
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:


When using AutoCompletion plugin, the _resizeMenu function won't take options.position.of into account.

Lets say I've got the following situation: <div class='container-autocomplete' style='margin: 10px'>

<input type='text' />


$(".container-autocomplete input", element).autocomplete({

minLength: 0, position: {

of: $(this).parent(), This is the line we append the autocomplete to at: "left bottom-1"


The menu won't get resized to the position.of, but to the <input> tag.

AutoComplete _resizeMenu:

_resizeMenu: function() {

var ul =; ul.outerWidth( Math.max(

Firefox wraps long text (possibly a rounding bug) so we add 1px to avoid the wrapping (#7513) ul.width( "" ).outerWidth() + 1, this.options.position.of == null ? this.element.outerWidth() : this.options.position.of.outerWidth()

) );


I guess this solution suits better than the current one, which will give the size of the element itself instead of the element you want to position it on.

But this might also be a developer choise.

Change History (2)

comment:1 Changed 10 years ago by Scott González

Component: ui.widgetui.autocomplete
Owner: set to xinix00
Status: newpending
Summary: Autocompletion: option.position.of, wrong resizementAutocomplete: Menu resizing should respect position.of option

When not aligning to the input, do you even want it to match up with the of option or just take up the necessary space based on the suggestions?

comment:2 Changed 10 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.