Opened 10 years ago
Closed 10 years ago
#9082 closed bug (duplicate)
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.
Change History (3)
comment:1 Changed 10 years ago by
Owner: | set to alexander_k |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
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.
comment:3 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | pending → closed |
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.