haltu / muuri

Infinite responsive, sortable, filterable and draggable layouts
https://muuri.dev
MIT License
10.77k stars 644 forks source link

Can't we have a placeholder size that fits the area to be positioned during dragging between two different areas? #511

Closed jiniC closed 2 years ago

jiniC commented 2 years ago

First of all, thank you so much for implementing so many features thanks to such a wonderful library! When the time comes, I would like to contribute to the development of this library.

I have a question about a problem that cannot be solved in the process of developing with muuri.

I would like to implement sorting between two areas that have items of different sizes. And I would like to use a placeholder to mark exactly where the actual item will be placed, even during dragging. Can't I have a placeholder size that fits the area to be positioned during dragging between two different areas?

When passing items from grid1 to grid2, it was possible to apply a style to the placeholder size, but the layout seems to work with the previous placeholder size. ( I tried adjusting the size of the item even when calling beforeSend and beforeReceive events, but it doesn't work properly. And I tested by forcibly adjusting the size of the item when the dragInit event of grid1 is called, but it doesn't seem to be the method recommended by the library. )

Here is a link to the codepen I'm testing. : https://codepen.io/jiniC/pen/wvPvGjb

스크린샷 2022-01-26 오후 12 00 47
jiniC commented 2 years ago

In the codepen environment, it was confirmed that it works when the width and height values ​​of the item are redefined in the beforeReceive event. It seems to be a problem caused by other influences of my work environment... Sorry for the hasty issue reporting. 😢