Opened 12 years ago
Closed 11 years ago
#6234 closed bug (wontfix)
Position: Elements with top or left set to "auto" are positioned incorrectly in Opera
Reported by: | neverov | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.position | Version: | 1.8.5 |
Keywords: | Opera | Cc: | [email protected]… |
Blocked by: | Blocking: |
Description
It seems that function position() from position.js works incorrectly in Opera 10 (10.63 under linux and 10.53 under windows).
Test to reproduce:
<html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script> </head> <body> <div style="margin-left: 100px; margin-top: 200px; border: 1px solid blue; width: 200px;"> <input type="text" id="my_input" value="test"/> </div> <script type="text/javascript"> var options = {my: "left top", at: "left bottom", collision: "none"}; $('<div style="border: 1px solid black; width: 100px;">test</div>') .appendTo('body') .show() .position($.extend({of: $('#my_input')}, options)); </script> </body> </html>
The div with text 'test' should be placed right under the input field. In Opera it is placed far below the input field.
A script in the test emulates functionality of autocomplete widget, which also does not work properly in Opera (autocompletion's <ul> placed in the left top corner of document, not under the input field).
Attachments (1)
Change History (13)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I'm getting the correct results in Opera 10.63.
Changed 12 years ago by
Attachment: | sample_opera_10.63.png added |
---|
Provided example rendered in Opera 10.63 (Windows Vista) and FireFox 3.0.19
comment:3 Changed 12 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
I have this reproducing: see attached sample_opera_10.63.png which is the provided sample HTML opened in Opera 10.63 and also in FireFox as a comparison.
comment:4 Changed 12 years ago by
Milestone: | TBD → 1.9 |
---|
I just confirmed that I am seeing exactly what's in your screenshot. I have no idea what was going on yesterday, I was getting a different result, but it was consistent across all browsers.
comment:5 follow-up: 6 Changed 12 years ago by
Scott, it seems like commit eab0a6dac13b642a870747249a360bdddb39da99 contains a fix for the issue.
comment:6 Changed 12 years ago by
Replying to neverov:
Scott, it seems like commit eab0a6dac13b642a870747249a360bdddb39da99 contains a fix for the issue.
That's unrelated; there's no confusion about whether or not we're a window in this case.
comment:7 Changed 12 years ago by
This is a bug in jQuery core where .offset() thinks that the element being positioned has a top of "221px" instead of "auto".
comment:9 Changed 12 years ago by
Scott, thanks for investigation.
While debugging page with autocomplete widget I noticed that
targetElem
in jquery.ui.position() contains field 'document' in
Opera and doesn't contain it in other browsers. So in all browsers
autocomplete's <ul> was positioned right under input element and in
Opera - in the top left corner of the page. In the commit
a0847f3a08dfc259d8ba7f6ba7da16653cf15183 you removed check for the
field 'document' and now <ul/> is placed correctly. Just FYI.
comment:11 Changed 12 years ago by
Summary: | Bug in position.js with Opera 10.63 → Position: Elements with top or left set to "auto" are positioned incorrectly in Opera |
---|
comment:12 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
This is fixed in newer versions of Opera and we no longer support the versions that have the broken behavior.
I checked it again and it turns out that plain autocomplete works fine, but problem with position exists anyway.