Opened 9 years ago

Closed 8 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: dmitry.neverov@…
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)

sample_opera_10.63.png (76.4 KB) - added by yaegor 9 years ago.
Provided example rendered in Opera 10.63 (Windows Vista) and FireFox 3.0.19

Download all attachments as: .zip

Change History (13)

comment:1 Changed 9 years ago by neverov

I checked it again and it turns out that plain autocomplete works fine, but problem with position exists anyway.

comment:2 Changed 9 years ago by Scott González

Resolution: worksforme
Status: newclosed

I'm getting the correct results in Opera 10.63.

Changed 9 years ago by yaegor

Attachment: sample_opera_10.63.png added

Provided example rendered in Opera 10.63 (Windows Vista) and FireFox 3.0.19

comment:3 Changed 9 years ago by yaegor

Resolution: worksforme
Status: closedreopened

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 9 years ago by Scott González

Milestone: TBD1.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 Changed 9 years ago by neverov

Scott, it seems like commit eab0a6dac13b642a870747249a360bdddb39da99 contains a fix for the issue.

comment:6 in reply to:  5 Changed 9 years ago by Scott González

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 9 years ago by Scott González

This is a bug in jQuery core where .offset() thinks that the element being positioned has a top of "221px" instead of "auto".

comment:8 Changed 9 years ago by Scott González

comment:9 Changed 9 years ago by neverov

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:10 Changed 9 years ago by Scott González

Thanks for the info neverov.

comment:11 Changed 9 years ago by Scott González

Summary: Bug in position.js with Opera 10.63Position: Elements with top or left set to "auto" are positioned incorrectly in Opera

comment:12 Changed 8 years ago by Scott González

Resolution: wontfix
Status: reopenedclosed

This is fixed in newer versions of Opera and we no longer support the versions that have the broken behavior.

Note: See TracTickets for help on using tickets.