Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Gridstack movement and resizing is constrained to the y-axis #868
Firstly, I would like to thank the developer(s) of gridstack for providing such an awesome and useful plugin! Great work!
I will greatly appreciate any help!
Subject of the issue
When moving or resizing an item, the placeholder acts as expected, while the gridstack item seems to be constrained to only the y axis. This is most likely an issue with my code and not gridstack.
Steps to reproduce
I have made a CodePen demonstrating my problem.
In this particular example I have a grid with a width of 35. To accomplish this, I used the SASS snippet included in the README of this project. I simply changed
The ideal behavior would be to either move with the placeholder, or not move at all until mouse up.
When dragging the item (either moving or resizing) the placeholder acts as expected. However, the gridstack item itself will ONLY move with the pointer up and down, as if it is constrained to the y-axis.
@StefanM98 I believe I can help you out! I looked in your example, and I see that in
The problem is that the
Thanks for the quick response!
Hmm.. I think I understand. So with 35 columns, the calculated width for
Forgive me if I misinterpreted you explanation.
I have attempted overriding those values in my css but the issue still occurs. Perhaps I'm doing it wrong? This is the css I added:
2% is less than any of the
Another thing I found interesting is that when a item has
@radiolips I removed
Thanks again for the help.
It could be related to the first issue I had noticed yesterday; I'm seeing that the widths of the widgets are set by
That was the problem! I adjusted the SASS to more directly reference the gridstack item and that resolved the issue. Bellow is the updated SASS if you would like to update your README with it ;)
Thanks a lot for helping me figure this out!