8000 added `gs-size-to-content` support by adumesny · Pull Request #2892 · gridstack/gridstack.js · GitHub
[go: up one dir, main page]

Skip to content
8000

added gs-size-to-content support #2892

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

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

adumesny
Copy link
Member
@adumesny adumesny commented Dec 9, 2024

Description

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

* fix gridstack#2886
* untested but should be fine :)
@adumesny adumesny merged commit 6d388ad into gridstack:master Dec 9, 2024
@@ -1741,6 +1743,7 @@ export class GridStack {
n.noResize = Utils.toBool(el.getAttribute('gs-no-resize'));
n.noMove = Utils.toBool(el.getAttribute('gs-no-move'));
n.locked = Utils.toBool(el.getAttribute('gs-locked'));
n.sizeToContent = Utils.toBool(el.getAttribute('gs-size-to-content'));
Copy link
@yusufkandemir yusufkandemir Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this one should support the number version as well. Without that, utilizing #2620 is not possible with gs-size-to-content.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct. file a bug, but as mentioned gs- attr is rather obsolete is real apps

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks.

Regarding it being "obsolete in real apps":
The Vue examples use render(), not to be confused by render functions, import { render } from 'vue' itself is a low-level API and not explained in Vue docs. It is simply not sufficient in frameworks / complex apps, as you can't simply use things like provide/inject, plugins, e.g. vue-router, Quasar, etc. inside the widget content. You would need to use createApp and do some low-level copying from the original app to that sub-app, then use that app to render widget content stuff, which is not really straightforward. So, I think gs- still has good use as it's far simpler and less prone in cases like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

real app should use JSON to load/save grids dynamically, and we have much better API support for all options... framework app (like my angular wrapper) gets callwed back to create the right component types.

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

Successfully merging this pull request may close these issues.

sizeToContent property is not initialized from gs-size-to-content
2 participants
0