fredsa / gwt-dnd

Library providing easy to use mouse or touch based drag-and-drop capabilities to GWT
43 stars 41 forks source link

dragStartSensitivity > 0 causes draggable droptargets to "fuse" together #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of GWT are you using? 
GWT 1.6.4

What version of the gwt-dnd jar file or library file are you using?
2.5.6

What operating system(s) are you using?
Windows Vista 32bit

Issue occurs in both hosted and web mode.

What browsers:
Firefox 3.0.8, IE8 8.0.6001.18702 , Google Chrome 1.0.154.53

What steps will reproduce the problem? 
Edit the demo file MatryoshkaExample.java to set dragStartSensitivity > 0:
 /**
  * Example of drop targets that are also draggable so that widgets can be
@@ -53,6 +52,7 @@
     // initialize our drag controller
     PickupDragController dragController = new
PickupDragController(boundaryPanel, true);
     dragController.setBehaviorMultipleSelection(false);
+    dragController.setBehaviorDragStartSensitivity(15);
     dragController.addDragHandler(demoDragHandler);

     // create our grid of draggable drop target widgets

What is the expected output? What do you see instead?
Same as when dragStartSensitivity = 0

Do you have a workaround?
No. Tried applying fix from issue 59 without success.

No additional information at the moment.

Original issue reported on code.google.com by hannson@gmail.com on 17 Apr 2009 at 5:14

GoogleCodeExporter commented 9 years ago
Failed to include some info:

When dragStartSensitivity is > 0 the draggable droptargets in the demo fuse 
together
(e.g. become a single draggable), making it impossible to drag a widget out of 
the
parent.

Original comment by hannson@gmail.com on 17 Apr 2009 at 5:16

GoogleCodeExporter commented 9 years ago
One other thing. This has obviously something to do with inconsistencies between
onMouseDown() and onMouseMove() in MouseDragHandler.java where different 
methods are
used to prepare for dragging.

Original comment by hannson@gmail.com on 17 Apr 2009 at 5:30

GoogleCodeExporter commented 9 years ago
Thanks for reporting this issue.

It turns out that the the MouseDragHandler was receiving multiple onMouseDown 
events, one for each draggable 
underneath the mouse cursor. The top widget would get marked first, but then 
the widgets underneath it would 
get marked instead. Ultimately the lowest widget would get selected and became 
draggable, dragging all the 
other widgets underneath it.

Fixed at trunk r887

Original comment by fredsa on 2 May 2009 at 6:23