With the newer versions of jQuery, the behavior of droppables seems to have changed. Previously, the "drop" event would trigger on the element the mouse had last hovered-over. In newer versions, it's more strict and if the mouse isn't actively over an element, it doesn't fire.

This is a problem because our "form-builder-placeholder" drop targets change their size as they are hovered-over. Usually they're big, invisible targets, but on hover they resize to match the size of the element being dragged. This resizing may cause the cursor to not be over the droppable, though the "hover" class is still applied, indicating that the drop would be successful. However when the user lets go of the item, the field just disappears instead of being dropped.

This patch resolves this problem by switching from the "drop" event to the "deactivate" event, which fires for each droppable element when the dragging event has finished.

Comments

quicksketch’s picture

Status: Needs review » Fixed

Tested this on:

Drupal 7: jQuery 1.3, 1.5, and 1.10
Drupal 6: jQuery 1.3

And it works across the board. Committed to both branches.

  • Commit e02d0af on 7.x-1.x by quicksketch:
    Issue #2247643 by quicksketch: When using jQuery 1.10+, droppabble...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.