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.
| Comment | File | Size | Author |
|---|---|---|---|
| form_builder_robust_droppables.patch | 1.79 KB | quicksketch |
Comments
Comment #1
quicksketchTested 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.