Bug Tracker

Ticket #3576 (closed enhancement: invalid)

Opened 6 years ago

Last modified 4 years ago

[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@…
Blocking: Blocked by:

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

comment:1 Changed 6 years ago by flesler

  • Owner set to joern

comment:2 Changed 5 years ago by dmethvin

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 .

comment:3 Changed 4 years ago by john

  • Status changed from new to closed
  • Resolution set to invalid
Note: See TracTickets for help on using tickets.