-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
addWidget() or DOM read in single column mode will not adjust to multicolumn mode #1985
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
Comments
Only a problem with nested grids, regular ones work (as I recall fixing that issue a while back) https://gridstackjs.com/demo/web1.html |
Do you recall when this issue was resolved (i.e. maybe I should update?)? I am having this issue while not using nested grids. Bit of a sloppy example, but it shows how the grid will appear differently when loaded in single column mode with these settings: |
no, but simple search would find related fixes... then you can see which release came after |
I looked through those and they seem to address similar issues that I am having, however, it does not appear to be working as intended for me. Here is a very plain example of the issue I am having: https://jsfiddle.net/ericpool/7k2jya48/6/ As you can see, when initializing it in single column mode, it forgets all positioning: |
ok, see the issue with simpler https://jsfiddle.net/adumesny/2r3tjnds/ |
Any workarounds for this issue? The same thing happens if you declare the grid items in the DOM: |
don't know of a workaround unless you patch the code, or add the items while in 12 columns, then go back to 1. But you are welcome to submit a fix, or donate to get it fixed... also your example decelis shows 2 issues - the order and the restore back to 12 (this bug), sight. |
@decelis |
fix gridstack#1985 fix gridstack#1975 (oneColumnModeDomSort case) * we now handle DOM and addWidget() when temporally into 1 column mode better to save the full 12 column mode * also DOM reading will reverse-sort entries to lay them in 1 column mode correctly (like if you had started with 12 and scaled down)
When a grid is loaded for the first time in single column mode instead of multicolumn mode, it will remain a single column when resizing to multicolumn mode. Multicolumn mode toggles on, but all the items remain in their left-aligned positions.
Using gridstack 4.6.2, but since it is happening in the demo too, doubt it is relevant.
You can see this happening in the demo page here:
https://gridstackjs.com/demo/nested_advanced.html
Just load the page with the browser at a small enough size to trigger single column mode, then adjust window size.
The text was updated successfully, but these errors were encountered: