Sortable: placeholder offset incorrect
|Reported by:||dstrohl||Owned by:||dstrohl|
In trying to troubleshoot a bug in a page I may have found a bug in jQueryUI.Sortable. When I try to drop an object onto a sortable object, it will often drop higher in the stack than it should. (I am holding the item under all of the items in the stack, but the placeholder is showing up at the top of the stack.
In troubleshooting this, I added some console output lines to the jqueryui code and found that it seems like when it is comparing the position of the event to the position of the item (around line 14330 or so in my copy) it is using the event[clientx/y] position compared to the item.offset() position. if I am reading the docs correctly, the clientX/Y position is based on the offset from the current window, and the item.offset() is based on the offset of the document (is that correct?) This seems like it might be valid as by moving the window up and down relative to the document, the placement of the placeholder changes.
Since I am not an expert in JS or JQuery, it is entirely possible that I am missing something here, or have mis-read the code or docs...
This seems like it might be a dupe of several other reported bugs, but none of them seemed to indicate that the problem had to do with the offset position.
I also verified that this happens with versions 1.10.3, 1.10.4, 1.11.1, and 1.11.2
I apologize for not creating a jfiddle for this, hopefully the description is good enough.. if not, I can see what I can hack together.
Change History (9)
comment:7 Changed 2 years ago by tj.vantoll
- Status changed from new to open
- Summary changed from Sortable placeholder offset incorrect to Sortable: placeholder offset incorrect
comment:8 Changed 12 months ago by arschmitz
- Resolution set to fixed
- Status changed from open to closed