Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic evaluation of the autocomp box container. #433

Merged
merged 1 commit into from
May 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion autocomplete_light/static/autocomplete_light/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,14 @@ yourlabs.Autocomplete = function (input) {
/*
We'll append the box to the container and calculate an absolute position
every time the autocomplete is shown in the fixPosition method.

By default, this traverses this.input's parents to find the nearest parent
with an 'absolute' or 'fixed' position. This prevents scrolling / resizing
issues that we'd have by boldly using <body>.
*/
this.container = $('body');
this.container = this.input.parents().filter(function() {
return ['absolute', 'fixed'].indexOf($(this).css('position')) > -1;
}).first();
};

/*
Expand Down