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

Responsive grids don't render items with minW correctly on resize #2676

Closed
rory-orennia opened this issue May 16, 2024 · 3 comments · Fixed by #2680
Closed

Responsive grids don't render items with minW correctly on resize #2676

rory-orennia opened this issue May 16, 2024 · 3 comments · Fixed by #2680
Labels

Comments

@rory-orennia
Copy link

Subject of the issue

If you setup responsive column breakpoints and also set the minW on a widget, and resize the window/grid down to something smaller than that minW, it will render incorrectly on resize and seems to just grab the minW * currentColWidth resulting in this:
image

Your environment

  • version of gridstack.js - 10.1.2
  • MacOS - Firefox

Steps to reproduce

https://jsfiddle.net/qjb3faLk/1/

  • Attempt to resize 0, works fine.
  • Attempt to resize 1, it expands outside the browser while resizing

Expected behavior

The resize display should be the size of the widget, even if that widget is currently smaller than the minW

@rory-orennia
Copy link
Author

Seems to be caused by this function:

protected _constrainSize(oWidth: number, oHeight: number): Size {

@afhammad
Copy link

+1

Was just evaluating gridstack and testing it's responsive handling and ran into this.

adumesny added a commit to adumesny/gridstack.js that referenced this issue May 25, 2024
@adumesny
Copy link
Member

fixed in next release. don't forget to donate if you find this lib useful!

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

Successfully merging a pull request may close this issue.

3 participants