-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
sizeToContent is not triggered when initializing from HTML #2552
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 is not triggered when initializing from HTML #2552
Comments
* fix gridstack#2552 where dom init wasn't calling sizeToContent Also: * fixed drag&drop not calling size either * prevent animation when loading (from empty) and when replacing placeholder with actual content (helps in sizeToContent) * resizeToContent() no longer use dic sizing (only node.h) so we rarely have to delay for animation (only when column widget changes) * bunch of renames (internal) to make cleaner. *** POSSIBLE BREAK (unlikely) * ResizeToContentFcn doesn't take optional useAttr arg anymore
fixed in next release. don't forget to donate if you find this lib useful! |
@adumesny thanks, but nothing really changed... Here is the updated fiddle for v10.0.1: https://jsfiddle.net/19mj7r5o/ |
You need to use the correct URL in the JSFiddle Resources? If you hover over it, you will see it's pointing to 10.0.0 |
@thadguidry I did just that, but somehow messed it up. All seems to be good now: https://jsfiddle.net/927om8he/2/ |
I used the official demo to fix html init (second grid of https://gridstackjs.com/demo/sizeToContent.html) |
Subject of the issue
When initializing GridStack from HTML, the items are not automatically resized to content. As a workaround, you can still manually resize the item or add
grid.cellHeight(50);
to trigger an update.For example:
Your environment
Can be reproduced on Chrome with GridStack 9 and 10.
Steps to reproduce
grid.cellHeight(50)
to get the desired behavior.Expected behavior
The item should be automatically sized to content after initialization.
The text was updated successfully, but these errors were encountered: