cuire / svelte-grid-extended

A draggable and resizable grid layout, for Svelte
https://svelte-grid-extended.vercel.app
MIT License
78 stars 9 forks source link

[Feature] Move non active item when two items overlap #16

Closed fabiot21 closed 1 year ago

fabiot21 commented 1 year ago

When dragging an item A, if this item overlaps with another item B. Then item B should be moved to the first place where it fits.

cuire commented 1 year ago

I designed GridItem component with that feature in mind. It should be done in that part of code:

https://github.com/cuire/svelte-grid-extended/blob/6837af03ab43a83a40fc4a7f6da51720afe8b80c/src/lib/GridItem.svelte#L104-L106

Instead of ignore all cases where item collides it should check gridParams and decide which strategy to use.

multiplehats commented 1 year ago

Would love to see this. This looks like this is the only promising library in the space. The api looks really clean, and the typings are 👏.

I took a look and cloned the repo hoping I could do a PR, but I'm not sure how to move other items out of the way. A bit above my paygrade I think lol.

fabiot21 commented 1 year ago

anyone working on this? if not, maybe I can give it a try soon

cuire commented 1 year ago

anyone working on this? if not, maybe I can give it a try soon

I have too many going on things. It would be great if you could make this. PR are more that welcomed here ✨