cuba-platform / cuba-dnd

Provides Drag & Drop functionality for platform UI components
Apache License 2.0
2 stars 1 forks source link

Question: disable dropping between subcomponents in DDCssLayout #6

Open Charrey opened 2 years ago

Charrey commented 2 years ago

Hello, I have a question about the previewing of eligable drop locations. When I have a target layout with some items already present, I expect a preview between those items when I hover over the drop location while holding a draggable item. This works find when the items already present are leaf components (e.g. buttons). However, when they are composite components (e.g. a vbox or hbox) I find some unusual behaviour: the previewer also previews drop locations between subcomponents of those items.

For example, provided the following descriptor:

<dnd:dndCssLayout id="dashboard"
    dragMode="CLONE"
    height="AUTO"
    width="100%"
    stylename="min-height">
    <vbox>
        <button caption="1"/>
        <button caption="2"/>
    </vbox>
    <vbox>
        <button caption="3"/>
        <button caption="4"/>
    </vbox>
</dnd:dndCssLayout>

...I can still drag items between the subcomponents of the vbox.

bug

In my application, the items in my drop target are highly composite with many nested subcomponents. The current preview behaviour results in a very glitchy UI. How can I make sure that only locations are previewed between root elements of the target layout?

Charrey commented 2 years ago

It seems to be related to this issue.