fredsa / gwt-dnd

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

Cannot drag >2 proxy items to the end of panel using AbstractInsertPanelDropController #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Dragging multiple proxy items to the end of a panel using a 
AbstractInsertPanelDropController produces an IndexOutOfBoundsException. I 
produced this using an app I'm building but can use the demo app as below.

What steps will reproduce the problem?
1. Go to 
http://allen-sauer.com/com.allen_sauer.gwt.dnd.demo.DragDropDemo/DragDropDemo.ht
ml#FlowPanelExample
2. Turn on multi select via ctrl/meta click
3. Turn on use drag proxies
4. Select more than one item using multi select (any items will do including 
the last one)
5. Drag to the end and drop
6. IndexOutOfBoundsException

What is the expected output? What do you see instead?
Expect the items to be dropped into the position they are places as per any 
other multi select using the same options but not dropping at the end. 
IndexOutOfBoundsException instead.

The unobfuscated stack trace using my own app:
at 
com.google.gwt.user.client.ui.ComplexPanel.checkIndexBoundsForInsertion(ComplexP
anel.java:140)  at 
com.google.gwt.user.client.ui.ComplexPanel.adjustIndex(ComplexPanel.java:105) 
    at com.google.gwt.user.client.ui.ComplexPanel.insert(ComplexPanel.java:189) 
    at com.google.gwt.user.client.ui.FlowPanel.insert(FlowPanel.java:71)    at 
com.allen_sauer.gwt.dnd.client.drop.AbstractInsertPanelDropController.onDrop(Abs
tractInsertPanelDropController.java:51)

Original issue reported on code.google.com by cknow...@gmail.com on 24 Sep 2010 at 3:51

GoogleCodeExporter commented 9 years ago
Is this just because the example uses a FlowPanel and not a FlowPanel with a 
spacer a bit like VerticalPanelWithSpacer?

Original comment by cknow...@gmail.com on 24 Sep 2010 at 5:58

GoogleCodeExporter commented 9 years ago
Yes, seem to have solved this by using the attached class instead of the 
standard FlowPanel. Perhaps these types of classes should be part of gwt-dnd?

Original comment by cknow...@gmail.com on 24 Sep 2010 at 6:28

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in r1048

Original comment by fredsa@google.com on 29 Sep 2010 at 6:15

GoogleCodeExporter commented 9 years ago

Original comment by fredsa@google.com on 29 Sep 2010 at 8:22

Attachments: