gridstack.js icon indicating copy to clipboard operation
gridstack.js copied to clipboard

[Bugs] Add a new widget in one column mode will affect the layouts after you switch back to multiple columns.

Open yesterdaytime opened this issue 2 years ago • 3 comments

Subject of the issue

When I try to add a new widget in one column, it will reset all the nodes in one modal and doesn't change back them the correct position in multiple columns mode.

Steps to reproduce

  1. start the gridstack.js angular example, and select component ngFor example.
  2. Add 3 widgets.
  3. Change the chrome width and make the widget show in one column.
  4. Add a widget and change the chrome width to back multiple columns mode.

Expected behavior

The 3 widgets should be at the top.

Actual behavior

The 3 widgets at the left.

yesterdaytime avatar Dec 06 '23 10:12 yesterdaytime

depends on where you add that 4th widget in 1 column. post a video or picture of what you are doing...

adumesny avatar Dec 06 '23 17:12 adumesny

The first time, item 1, item 2, and item 20 at the top, I wanted to keep them at the top after I added a new one in the one column mode, but they changed to the left. I need to change them to the top again. I think the new widget position only affects item 20, it doesn't affect item 1 and item 2.

https://github.com/gridstack/gridstack.js/assets/14917134/ec6bce95-858c-4b1e-a508-f941e5051b4c

yesterdaytime avatar Dec 07 '23 02:12 yesterdaytime

I changed the demo to append new item at the end rather than specific location which is hard to predict when doing in 1 column vs 12 anyway. don't forget to donate if you find this lib useful!

adumesny avatar Mar 30 '24 21:03 adumesny