#944 ✓fixed_in_master_branch

Drag and drop doesn't work when dragging from scrolled scrollable div

Reported by c00rdb | November 23rd, 2009 @ 05:25 PM

Problem lies within the cumulativeOffset function. Made the following changes to correct so that the element doesn't appear below the mouse pointer when dragging.

  cumulativeOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      //fix offset error with scrollable div
      valueT -= element.scrollTop;
      valueL += element.offsetLeft || 0;
      element = element.offsetParent;
    } while (element);
    return Element._returnOffset(valueL, valueT);

To reproduce, make draggable elements in a scrollable div and scroll the div down before attempting to drag one of the elements. It will drag but appear below the cursor by however many pixels you scrolled down.

Comments and changes to this ticket

  • Tisho Georgiev

    Tisho Georgiev March 1st, 2010 @ 02:42 PM

    • State changed from “new” to “fixed_in_master_branch”
    • Tag set to needs:failing_testcase, section:dom

    This issue appears to have been fixed somewhere along the way. I'm adding a test bundle to this ticket, so you can quickly check if the bug is still there. Let us know if that's the case.

    Thanks for taking the time to contribute.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins