-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Gridstack movement and resizing is constrained to the y-axis #868
Comments
@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 haven't tested it myself, but you should actually be able to override those values in your own css, so you should be able to use as many columns as you want. |
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 |
Oh! My mistake. Turns out there were two problems. The change you made should be fine, but there's something else causing the item to only move vertically. I'll give you an update when I know what's going on! |
Sounds good! Thank you very much for your support! |
@StefanM98 I have an answer for you! Stop using |
@radiolips I removed Removing 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! 👍 |
No problem. You should put in a PR with an update to the README, @StefanM98 ! |
Will do! :) |
I updated the SASS code snippet in README.md to more directly reference the gridstack item, and avoid problems where the widths of the gridstack items, are still set by gridstack.css and not this code. See issue gridstack#868 (gridstack#868) for an example.
Thank you StefanM98, I too am facing the same issue with 30 column grid, I did use your improved SCSS and generated CSS from that, but it was still taking the style from gridstack.min.css, I assume you must have used !important to override the basic styles, so I have done that, can you please confirm that? it has resolved the y-constraint issue, but now when I use the !important along with new styles, it creates another problem - whenever I resize the widget it changes location of the widget even though there is another widget at that location and also changes the location of other widget. you can notice it in the screenshot below, appreciate any help on this. |
@ashutosh-kendurkar are you using the latest 2.0.2 ? also the doc https://github.com/gridstack/gridstack.js#custom-columns-css |
thanks for the quick reply @adumesny I am using "gridstack.js 1.2.0" in a .Net application with vanilla JS. I did try to upgrade today briefly to 2.0.2 but it failed with lots of console errors, so I will try that over the weekend. I basically want to have smaller breakpoints for widget height and width, height is possible with I will try your suggestion on custom class for |
2.0.0 has the "many column" round off error fixed - https://github.com/gridstack/gridstack.js/releases/tag/v2.0.0 |
@adumesny thanks, I will try that. |
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!
Thanks,
Stefan
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.
My environment
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
$gridstack-columns: 12;
to$gridstack-columns: 35;
and then used Sassmeister to convert the SASS to CSS and used that in my example code.Expected behavior
The ideal behavior would be to either move with the placeholder, or not move at all until mouse up.
Actual behavior
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.
The text was updated successfully, but these errors were encountered: