parttio / dragdroplayouts

Drag and Drop for Vaadin layouts
7 stars 23 forks source link

Drop inside other layouts does misplace drop at end of components #58

Open a-schild opened 8 years ago

a-schild commented 8 years ago

When the components which are placed inside a DDxxxLayout are themself containers, the drop can be done inside such a layout. The result is then, that the droped component is placed at the end of the layout and not in the place of the drop.

Here a example screenshot where the DDCssLayout is used, and the components to drag&drop are VerticalLayouts with two button on them.

As long as we drag it over the VerticalLayouts it works fine, but when the drop indicator shuffles inside the VerticalLayouts things get messy.

Sample code with the default DefaultCssLayoutDropHandler drop handler active

    private class DragComponent extends VerticalLayout
    {
        public DragComponent(int i)
        {
            setMargin(true);
            setHeight(10, Unit.EM);
            setWidth(10, Unit.EM);

            Button button1= new Button("Panel "+i);
            addComponent(button1);
            Button button2= new Button("Button2");
            addComponent(button2);
        }
    }

mozilla firefox_2016-04-15_15-54-36

aheintz commented 8 years ago

I'm having the same problem. I've grouped a few components in a CssLayout which I want to drag and drop as a single item. But dragging over other components composed the same way shows that the drop can be shown within that component. Tried getting around the problem using the AcceptCriterion.accept() but am not able to distinguish between a correct placement and one within subcomponent.

a-schild commented 8 years ago

The fix mentioned above is specific for the DDCssLayout, but I think most other DD layouts would need a similar fix too...

Charrey commented 2 years ago

Is there any chance this will still be fixed? I am having the described problem.

a-schild commented 2 years ago

The Issue is open since almost 6 years now. Since Vaadin 8 is now out of normal support, I don't expect anything here. But since you have the full source code... ;)