cuire / svelte-grid-extended

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

[Feature] Implement Swap action #93

Open Omicrxn opened 2 weeks ago

Omicrxn commented 2 weeks ago

Based on the image below, if from left to right the GridItems are 1 (blob) ,2 (party dog) and 3 (ice cream), In case I'd like to swap Item 1 for Item 3, when dragging Item 1 on top of Item 2, It would push Item 2. I'd like the behaviour to only swap Item 1 for Item 3 without pushing Item 2. An excellent behaviour in my opinion would be to do the swap if the dragged element is on top of the element to swap for 1 second or some time that feels right. This library for example has a great behaviour https://swapy.tahazsh.com/

I know there are some edge cases regarding size and position but maybe we can choose wether in case the size doesn't match we could push the element, or cancel the drop or something. The annoying behaviour is just when you are dragging on top of an element which you don't even want to move

image
cuire commented 2 weeks ago

Amazing idea, I like it ❤️ Added to v2 milestone

Omicrxn commented 2 weeks ago

awesome! just out of curiosity, what time expectation do you have for v2.

cuire commented 2 weeks ago

awesome! just out of curiosity, what time expectation do you have for v2.

I dont have any tbh. I just changed jobs and it takes a lot of time for onboarding. At least Ill try to write all ideas in a form of issues in a week.