[UI] Drag and drop of user does not work if scrolled
I'm in the mac ui, but I'd imagine it is the same for all versions.
- Join 20 users/groups - they are on left hand pane.
- scroll down to bottom (or middle)
- drag a person.
PROBLEM: The user drag ends way up on the page. Or it doesn't work.
Suggested Technical problem: The mouse click is not translated properly so the starting drag location is way up the page.
I think it is a common error around the detection of "where" the mouse clicked down and not properly translating from window to screen coordinates properly. In this case, I'd imagine the library is translating the body
scroll, but not the scroll in #recents-region
.
I don't know your exact code, but the problem code probably looks a little like:
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
Sorry, don't have a solution for you, but hope this will point in right direction.