Skip to main content

Bug Tracker

Side navigation

#3576 closed enhancement (invalid)

Opened November 05, 2008 01:47PM UTC

Closed February 05, 2010 08:29PM UTC

[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: Pablote.20@gmail.com
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

Attachments (0)
Change History (3)

Changed November 06, 2008 09:42PM UTC by flesler comment:1

owner: → joern

Changed October 13, 2009 12:12AM UTC by dmethvin comment:2

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 .

Changed February 05, 2010 08:29PM UTC by john comment:3

resolution: → invalid
status: newclosed