Opened 14 years ago
Closed 13 years ago
#3576 closed enhancement (invalid)
[autocomplete] Showing results at page bottom, and not at the input field
Reported by: | Tomasso | Owned by: | joern |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | plugin | Version: | 1.2.6 |
Keywords: | autocomplete, scroll | Cc: | [email protected]… |
Blocked by: | Blocking: |
Description
When the autocomplete input field is inside a div which has a scrollbar, the results will not be shown at the input field position as expected, but probably at the bottom of the page. To fix that issue I modified the showResults function as follows:
function showResults() {
get the position of the input field right now (in case the DOM is shifted) var pos = findPos(input); either use the specified width, or autocalculate based on form element var iWidth = (options.width > 0) ? options.width : $input.width();
var firstParentDIV; var currentNode = input; while (currentNode.tagName.toLowerCase() != "div"){
currentNode = currentNode.parentNode;
}
reposition $results.css({
width: parseInt(iWidth) + "px", top: ((pos.y + input.offsetHeight) - currentNode.scrollTop) + "px", left: pos.x + "px"
}).show();
};
Thank You:
Pablo Tomas Borda Di Berardino
Change History (3)
comment:1 Changed 14 years ago by
Owner: | set to joern |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is not a jQuery core bug. Please report plugin bugs to the plugin's author, or ask on the jQuery forums. jQuery UI bugs should be reported on the UI bug tracker, http://dev.jqueryui.com .