fredsa / gwt-dnd

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

Possible Bug : Clearing selection list in AbsolutePositionDropController #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of GWT are you using? 1.3.3? 1.4.60? Other?
2.0

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

What operating system(s) are you using? Windows? Linux? Mac?
OS X 

Does the issue occur in web mode, hosted mode, both or don't know?
Both

What browser(s) do you use? Firefox, IE, Safari, other?
Safari

What is the browser version (if you know) from Help->About?
4

What steps will reproduce the problem? Please attach sample code if you
can.

It appears that there are cases where the 
AbsolutePositionDropCotroller.onLeave() method should be called and 
isn't.  Without calling on onLeave(), the selected list is not cleared and the 
*next* time you you us the dropcontroller you get an error in the assert at 
line 105 because selectedList.size()!=0

I found this because when you are using a Drag Proxy in your 
PickupDragController and there is a veto--say because you said to disallow 
drops on the boundary so the internal AbsolutePositionDropController is 
being used--there is a code path that ends up not calling onLeave() on the 
drag controller and causing the (delayed) problem.

The suspicious looking code (to me) is in PickupDragController.dragEnd() 
around line 120 in the case where you ARE using a drag proxy and there is 
a veto.

Is there something I missed about how to use this controller or about how 
to use/configure with DragProxy objects?

Do you have a workaround?
Here is my workaround, in a subclass of PickupDragController
   @Override
    public void dragEnd() {
        DropController dropController = context.dropController;

        super.dragEnd();
        dropController.onLeave(context);

    }

Original issue reported on code.google.com by ians...@gmail.com on 13 Feb 2010 at 12:40

GoogleCodeExporter commented 9 years ago
Thanks for the detailed report.

I believe this was fixed in r1015

Original comment by fredsa@google.com on 14 Feb 2010 at 5:53