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: |
Description
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' />
</div>
$(".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 = this.menu.element; 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
Component: | ui.widget → ui.autocomplete |
---|---|
Owner: | set to xinix00 |
Status: | new → pending |
Summary: | Autocompletion: option.position.of, wrong resizement → Autocomplete: Menu resizing should respect position.of option |
comment:2 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
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!
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?