Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

programatic resizing of grid item causes collision detection to reorder items #247

Open
lkirby1266 opened this issue Jun 30, 2017 · 3 comments

Comments

@lkirby1266
Copy link

https://plnkr.co/edit/ou5UhYLKJUQ8d5M0ju27?p=info

If you resize an item such that it causes multiple collisions, the order of the widgets returned by the collision detection keeps reversing. In the example plunk, if you click makeBig on item 1, then items 2,3,4 get reordered as 4,3,2.

Suggest revising _getCollisions() to return
returns.reverse()
instead of
returns

@lkirby1266
Copy link
Author

Also, in the same plunk, if you just drag item 1 to the right a little, and release, it will reorder 2,3,1,4 even though there should not have been any collisions detected.

@sconix
Copy link
Contributor

sconix commented Dec 3, 2017

We are also experiencing this and its preventing us to do a release atm. I will have a look if I can find the reason, but I can already say that returns.reverse() wont fix the issue. It works if there is only 1 column, but already with 2 columns it won't help and it almost seems like the items are getting randomly moved. In our application it works for some reason if I change the getCollisions to always return empty array. So there is definitely something wrong.

@sconix
Copy link
Contributor

sconix commented Dec 3, 2017

Actually our problem was different. The fault in our case was accidental resetting of the grid settings :).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants