Skip to content
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

sizeToContent property is not initialized from gs-size-to-content #2886

Closed
schwarzwald opened this issue Dec 2, 2024 · 2 comments · Fixed by #2892
Closed

sizeToContent property is not initialized from gs-size-to-content #2886

schwarzwald opened this issue Dec 2, 2024 · 2 comments · Fixed by #2892

Comments

@schwarzwald
Copy link

schwarzwald commented Dec 2, 2024

sizeToContent property is not initialized from gs-size-to-content

The sizeToContent property of the gridstack items is not initialized from the gs-size-to-content attribute when gridstack is created from existing HTML content.

Your environment

  • version of gridstack.js <= 11.1.0
  • any browser

Steps to reproduce

Initialize the gridstack from existing HTML, set gs-size-to-content="true" to some item.

https://jsfiddle.net/mntg136x/1/

Expected behavior

Based on the documentation all item properties should be initialized from the HTML attributes.
See https://github.com/gridstack/gridstack.js/blob/master/doc/README.md#item-attributes

@adumesny
Copy link
Member

adumesny commented Dec 3, 2024

honestly I stopped using dom attr a long time ago. tons of new feature are JSON/API only as for real apps you need to save data to json anyway, and doing a grid.load() is so much better....

@schwarzwald
Copy link
Author

Thank you for the quick fix, I appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants