-
-
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
[Bug] After load(), in some cases the Y position is determined incorrectly & sizes are not restored. #2669
[Bug] After load(), in some cases the Y position is determined incorrectly & sizes are not restored. #2669
Comments
There is also a problem with the sizes of elements when Load() bandicam.2024-04-24.16-12-42-666.mp4 |
the bug could be in the demo itself (fail to load the saved data) or the lib, but a bug reguardless... |
No, this is not an error reading saved data. This shows up in my development environment as well. As far as I understand, the error depends on the arrangement of the elements. Yes, it does not always appear. But try for yourself to perform the actions that I filmed on video and you will be convinced of the mistake! |
I'm having a similar problem too. When I set float: true, this problem disappears, but I do not want to use the float feature. |
@erdoganfurkann that is a good hint! likely repacking after each item instead of after all info are read in. |
I have a temporary solution that worked for me. I always initialize the grid stack with float: true option, then change float to false using gridstack's float() method. I call float(false) in the dragstart and resizestart event handlers, but I guess this can also be called in a callback function that runs after the DOM is loaded. |
if someone wants to donate I could take a look but I'm really busy these days, else make a fix. thanks. |
I'm seeing cases where |
@brian-patrick-3 that's likely a different issue. please file a bug with runninge example. |
The bug I described appears both with float: false and with float: true |
@IgorA100 the video is not playing for me (plays 5 sec then stops). Could you show using picture the state you need to save + load showing the issue ? can't debug without steps. tried editing that serialized demo and moving things around, doing a save + clear does reload the exact same state for me. |
thanks, I can see the issue now. doing a clear shows the item correctly loading though. |
I also wrote about the second error #2669 (comment) |
fixed in next release. don't forget to donate if you find this lib useful! |
* more fix gridstack#2669
Subject of the issue
I save current layout and then load it. In some cases, elements are assigned the value
gs-y="0"
instead of the storedgs-y="3"
This is also confirmed at https://gridstackjs.com/demo/serialization.html
Your environment
Steps to reproduce
bandicam.2024-04-24.15-31-43-405.mp4
Expected behavior
After load() element's Y position should always match the stored
gs-y="3"
, notgs-y="0"
The text was updated successfully, but these errors were encountered: