Skip to main content

Search and Top Navigation

#9082 closed bug (duplicate)

Opened February 12, 2013 08:55PM UTC

Closed February 22, 2013 02:44AM UTC

First time dragged element could have wrong offsets because "absolute" position is not set at helper

Reported by: alexander_k Owned by: alexander_k
Priority: minor Milestone: none
Component: ui.sortable Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:
Description

There is a line with a comment in the code:

Only after we got the offset, we can change the helper's position to absolute

And after this line "absolute" position is set to helper

this.helper.css("position", "absolute");

this.cssPosition = this.helper.css("position");

But before the comment line offset is extended, where offset.parent is set:

parent: this._getParentOffset()

And _getParentOffset method uses "absolute" position to calculate real parent offset.

Moving offset extend method under

this.cssPosition = this.helper.css("position");

fixes the bug.

Attachments (0)
Change History (3)

Changed February 13, 2013 02:36AM UTC by tj.vantoll comment:1

owner: → alexander_k
status: newpending

Hi alexander_k,

Thanks for taking the time to contribute to the jQuery UI project. Can you please provide a reduced test case that shows the issue you are describing. You can use this as a starting point - http://jsfiddle.net/tj_vantoll/wjxe4/.

Thanks.

Changed February 21, 2013 04:47PM UTC by Douglas_BTX comment:2

_comment0: Thanks for setting up the jsfiddle outline tj.vantoll. Here's a reproduction: http://jsfiddle.net/wjxe4/37/ It only happens the first time, but pressing "Run" resets it ready to try again.1361465702677353

Thanks for setting up the jsfiddle outline tj.vantoll. Here's a reproduction: http://jsfiddle.net/wjxe4/37/

It only happens the first time, but pressing "Run" resets it ready to try again.

Changed February 22, 2013 02:44AM UTC by tj.vantoll comment:3

resolution: → duplicate
status: pendingclosed

Duplicate of #5039.Thanks. This is a duplicate of #5039 but now we have a good reduced test case for that issue.