-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Items overlapping issue #150
Comments
Can you send me a repl please? |
This is kinda how I'm trying to work on it: https://svelte.dev/repl/33091a6496f6435085ed7c75a6cb8c17?version=4.2.0 |
Thanks for the repl https://svelte.dev/repl/efc9e48ce68a4079a1c1d5a584660671?version=4.2.0 (forked) I have slightly changed the const addWidth = (item) => {
let newItems = items.map((value) => {
if (value.id === item.id) {
value[COLS] = { ...value[COLS], w: value[COLS].w + 1 }
}
return value
})
items = gridHelp.adjust(newItems, COLS)
} I updated the array of items and then assigned it to a new variable called |
Thank you for your replay 🙌 the thing is that I'm trying to avoid using |
I know it's annoying. it shouldn't work like that I'll fix it (#64) |
Thank you so much ❤️ |
I updated the Try this and let me know if it fixes your issue or not. I think this may work the best If you resize the element using the ui, the element might end up at the bottom position |
Hello @vaheqelyan, in the new version 5.1.2 of the lib, I think there is bug with the 'adjust' helper. In the previous version 5.1.1, I've used this helper function to align items after I manually sort them. The behaviour was what I was expected, the items adjust to fill the free spaces and keep the order of them. No matter how many times I trigger 'adjust'. If they are adjusted, they stays that way.
Now in version 5.1.2 when I trigger 'adjust' first time items align and fill empty spaces. Then every time when I 'adjust' again, they are resorted and the items are messed up. Can you check it please. Does this is the behaviour we want. If it would be helpful, here is updated version of 'adjust' helper from 5.1.1 with the sorting function that I'm using in my current implementation:
Thank you so much, for the great lib and support |
I'm trying to remake the https://bento.me grid using your package, so far so good
but I want to use variant buttons to resize instead of the resizer functionality, for example, a button on each item that will change the
w: 1, h: 1
tow: 2, h: 2
so what happens is that the size changes but it doesn't adjust, it's like the adjustment happens before the size change because on the second click it pushed to touching blocks around, I tried to use
gridHelp.adjust
but it ruins the order and placements of all items and it removes the empty space, andnormalize
doesn't seem to do much, is there a way to trigger the adjust function but without having the order and such to be affected?First size change click:
Second size change:
The text was updated successfully, but these errors were encountered: