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

Allow collision option #27

Closed hearthole closed 1 year ago

hearthole commented 1 year ago

I added an option regarding #16. this option will work as follows.

  1. If collision occurs, the position of the preview will be exchanged with that of the collision target.
  2. If the position exchange leaves a blank space, all items will be compressed to the top where they can be.
  3. It will deprecate "rows" option (fix to 0).
  4. I mainly referred to https://jbaysolutions.github.io/vue-grid-layout/guide/01-basic.html
cuire commented 1 year ago

Hey @hearthole. Thanks a lot for your work 💖💖💖💖

cuire commented 1 year ago

It seems like you forgot to commit getCollisions function 👀

hearthole commented 1 year ago

getCollisions is default method that you made. do you have any problems to test?

cuire commented 1 year ago

getCollisions is default method that you made. do you have any problems to test?

That was unexpected. I saw a new function import and assumed that its new. Forgot that it is part of lib already 😬

cuire commented 1 year ago

I'll merge this right after the tests, but rewrite some parts to adapt it to the new API and maybe change the it a bit. Will be part of 1.0

hearthole commented 1 year ago

I got it. thank you for awesome project. 😄

hearthole commented 1 year ago

can you check my new commit?

cuire commented 1 year ago

Linting issue was mb, but ty. I would like to change current collision api. I think the compress field ll be neat. With it, the grid determines how to act in different scenarios. And for example current implementation will be achived with compress = 'vertical', collisions = true. Ill open an issue for that. Thanks for the work you've done 🖤💖🖤 I think I'll merge this PR and release it as 0.3, with a note that it's experimental (like the whole project).

hearthole commented 1 year ago

Good idea. I think it requires further development too.