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

Nested grids vs OneColumnMode : problem when loading webpage in small res and slowly turning back to high res #1538

Closed
tmnz-perso opened this issue Dec 16, 2020 · 2 comments · Fixed by #1603
Labels

Comments

@tmnz-perso
Copy link

tmnz-perso commented Dec 16, 2020

Subject of the issue

Nested grids with disableOneColumnMode set to false seem to :

  1. fall well to one column when width goes low, but fail recovering their columns when width "slowly" re-increases
  2. keep their columns when webpage loads directly with low width

Your environment

  • version of gridstack.js : gridstack-h5.js v3.1.2
  • browser : Chrome 87.0.4280.88 / Firefox 68.12esr

Steps to reproduce => Actual behavior

https://jsfiddle.net/zh2rabyg/

  1. reduce width to get one column view, then slowly increase width => main grid recovers its columns, but nested ones do not
  2. reduce width to get one column view, the re-run the fiddle => main grid is one column-ed ; but nested ones are not

Expected behavior

Nested grids should behave the same as main grid.

@adumesny
Copy link
Member

yep, the initial loading in fifddle should actually load the nested ones as oneColumn as they are <768px, and it looks like the sizing of the outer grid doesn't force inner grids to go 1 column... this might be hampered by cells animating to new sizes and us having to when done check for nested to go oneColumn or not.

adumesny added a commit to adumesny/gridstack.js that referenced this issue Jan 31, 2021
* fix gridstack#1538
* we now call resize on nested grids when window changes size
* we also call nested grid of the currently being resized item as it happens (live)
* updated nested.html to show more complete case, with custom column and different oneColumn constrain
@adumesny
Copy link
Member

fixed in next 3.3 release. Don't forget to contribute if you find lib useful!

20210131_101008.mp4

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.

2 participants