dnd-grid icon indicating copy to clipboard operation
dnd-grid copied to clipboard

Enhancement: Add posibility for the grid to be dragged around

Open ThaDaVos opened this issue 7 years ago • 7 comments

It would be really cool if you could drag the grid itself and everything would move with it, also the pinned boxes.

This would be really useful on small screens so you can move the grid and get to the part where you want to be.

you could make it so that when doing this it just selects all boxes and drags multiple at once

ThaDaVos avatar Mar 28 '18 12:03 ThaDaVos

You can nest multiple grids

<dnd-grid-container>
    <dnd-grid-box></dnd-grid-box>
    <dnd-grid-box></dnd-grid-box>
    <dnd-grid-box>
    <dnd-grid-container>
        <dnd-grid-box></dnd-grid-box>
        <dnd-grid-box>
            <dnd-grid-container>
                <dnd-grid-box></dnd-grid-box>
                <dnd-grid-box></dnd-grid-box>
                <dnd-grid-box></dnd-grid-box>
            </dnd-grid-container>
        </dnd-grid-box>
        <dnd-grid-box></dnd-grid-box>
    </dnd-grid-container>
    </dnd-grid-box>
</dnd-grid-container>

dattn avatar Mar 28 '18 13:03 dattn

Not really what I meant - I meant dragging the underlying grid itself, like the same mechanic you can when zoomed in in http://draw.io - you can drag around using the middle mouse button

ThaDaVos avatar Mar 28 '18 13:03 ThaDaVos

That is out of scope of the dnd-grid-container, but a task for the parent component.

dattn avatar Mar 30 '18 14:03 dattn

Something which dnd-grid-container could do maybe is allow negative coördinates and somehow centering on 0,0 - this way dragging could be implemented in dnd-grid-container or the parent

ThaDaVos avatar Mar 30 '18 14:03 ThaDaVos

I really don't see which problems does this solve. Can you give some well explained examples ?

dattn avatar Jun 15 '18 08:06 dattn

On small screens this would be an amazing feature, because overflowing boxes can still be at the pre-determined location only they will be offscreen until you scroll to them

ThaDaVos avatar Jun 15 '18 09:06 ThaDaVos

As dattn already said, this is no feature for the dnd-grid-container but should be handled outside of the component. If you want to move your dnd-grid-container around then your parent component should handle the position of the dnd-grid-container. Another solution I could think of, is to nest your "moveable" dnd-grid-container into another dnd-grid-container to make it a moveable "box".

cries avatar Jun 15 '18 09:06 cries