#15021 closed bug (fixed)
JQuery UI Sortable : get wrong top and left in function _getParentOffset
Reported by: | zudar | Owned by: | Scott González |
---|---|---|---|
Priority: | minor | Milestone: | 1.12.2 |
Component: | ui.sortable | Version: | 1.11.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
in function _getParentOffset
if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) { po.left += this.scrollParent.scrollLeft(); po.top += this.scrollParent.scrollTop(); }
After I sort the elements frist time. "this.cssPosition" always equals "absolute",When I sort the elements next time , get wrong top and left.
I update with follow code.The "helper" get the right position.
if(this.helper.css("position", "absolute") === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) { po.left += this.scrollParent.scrollLeft(); po.top += this.scrollParent.scrollTop(); }
Change History (3)
comment:1 Changed 7 years ago by
comment:2 Changed 6 years ago by
Owner: | set to Scott González |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In 1d40952:
comment:3 Changed 6 years ago by
Milestone: | none → 1.12.2 |
---|
Note: See
TracTickets for help on using
tickets.
another option might be to move the assignment of this.cssPosition in _mouseStart above the code that calls the _getParentOffset method. I imagine this might solve some potential issues with _getRelativeOffset which also makes use of this.cssPosition which is currently undefined the first time you drag.