10000 restrict vertical resize with sizeToContent by adumesny · Pull Request #2612 · gridstack/gridstack.js · GitHub
[go: up one dir, main page]

Skip to content

restrict vertical resize with sizeToContent #2612

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
Feb 4, 2024

Conversation

adumesny
Copy link
Member
@adumesny adumesny commented Feb 4, 2024

Description

  • since sizeToContent:true will automatically size the content vertically, don't let the user change the height to start with

Note: tried to change the feedback to have e,w arrows but we only have 10px area which is too narrow to show feedback (we have 20x20 for corners that may overlap content which is ok). Showing normal handles for now.

Checklist

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

* since sizeToContent:true will automatically size the content vertically, don't let the user change the height to start with

Note: tried to change the feedback to have e,w arrows but we only have 10px area which is too narrow to show feedback (we have 20x20 for corners that may overlap content which is ok). Showing normal handles for now.
@adumesny adumesny merged commit c3ccb12 into gridstack:master Feb 4, 2024
@cff3
Copy link
cff3 commented Mar 3, 2024

Hi @adumesny as far as I can see, this change prevents a user from resizing a widget vertically even if sizeToContent was set to a number instead of setting it to true. Is this intentional?

On the demo page (https://gridstackjs.com/demo/sizeToContent.html) it is still possible to resize widget E, but maybe the demo site uses an older version of grid stack? I didn't manage to understand what version is used on the demo site.

@adumesny
Copy link
Member Author
adumesny commented Mar 3, 2024

It's a bug. Number should let you resize that's the all point. I made the tweak too fast...

adumesny added a commit to adumesny/gridstack.js that referenced this pull request Mar 3, 2024
fix gridstack#2612 to allow resize when you have a number (soft max)
@adumesny adumesny mentioned this pull request Mar 3, 2024
3 tasks
adumesny added a commit to adumesny/gridstack.js that referenced this pull request Mar 3, 2024
fix gridstack#2612 to allow resize when you have a number (soft max)
@yusufkandemir
Copy link
yusufkandemir commented Mar 11, 2025

This is a breaking change. I am yet to understand if sizeToContent: number in nodes or anything else is an alternative viable solution to preserve the old behavior. But, the migration guide should definitely mention this change, preferably with an alternative. @adumesny if you could do this, that would be great. If you could offer an alternative, that would be even greater, thanks.

@adumesny
Copy link
Member Author

@yusufkandemir it is not a bug, but by design, incorrect before. sizeToContent:true means h is derived from content ONLY so users should not manually resize it (would be no-op), otherwise turn it off.

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.

3 participants
0