Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8749 closed bug (fixed)

Autocomplete dropdown positioned incorrectly in IE

Reported by: amasniko Owned by:
Priority: minor Milestone: 1.9.2
Component: ui.autocomplete Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

The problem is reproducible with both IE 8 and 9, but works fine in Firefox. When the screen has to be scrolled down to reach the input element on which autocomplete is enabled, after the first keystroke the dropdown appears somewhere above the input. On the second keystroke it moves to the correct position.

You can try try it here (make sure you use IE): http://jsbin.com/eyipab/1

Fortunately, the fix is very simple. Just adding this to the style corrects the problem:

.ui-autocomplete {
	left: 0;
}

It turns out that the "left" value is "auto" by default and the code in that case takes a different path.

Change History (7)

comment:1 Changed 7 years ago by tj.vantoll

Resolution: wontfix
Status: newclosed

Thanks for taking the time to contribute to the jQuery UI project! Your test case is in quirks mode which jQuery and jQuery UI do not support. If I add a doctype to your test case it functions fine in IE8 and IE9 - http://jsbin.com/eyipab/6.

comment:2 Changed 7 years ago by amasniko

Fair enough, I over trimmed the test case. I put back the some style to html and body elements I had initially removed and even with the doctype declaration IE exhibits the problem.

Now, I do not quite remember why I had to add that style. There are quite a few more nested elements on the real page and I needed them to get the effect I wanted. Regardless, I think the style is still valid and the dropdown should appear where it is supposed to like it does in Firefox.

The modified page is here http://jsbin.com/eyipab/9

comment:3 Changed 7 years ago by Scott González

Resolution: wontfix
Status: closedreopened

comment:4 Changed 7 years ago by Scott González

I don't think we support the styles you're setting on html/body, but this is an easy fix.

comment:5 Changed 7 years ago by Scott González

Resolution: fixed
Status: reopenedclosed

Autocomplete: Set initial left position for menu. Fixes #8749 - Autocomplete dropdown positioned incorrectly in IE.

Changeset: d693ce5324f6f3be8479ef083e4eaf3c705ef043

comment:6 Changed 7 years ago by Scott González

Autocomplete: Set initial left position for menu. Fixes #8749 - Autocomplete dropdown positioned incorrectly in IE. (cherry picked from commit d693ce5324f6f3be8479ef083e4eaf3c705ef043)

Changeset: 8f0daea9eb0b5e6feb31b1e69878919bce78cef1

comment:7 Changed 7 years ago by Scott González

Milestone: 1.10.01.9.2
Note: See TracTickets for help on using tickets.