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

Resizable grid items with dynamic content? #1190

Open
tillinb opened this issue Jun 9, 2023 · 0 comments
Open

Resizable grid items with dynamic content? #1190

tillinb opened this issue Jun 9, 2023 · 0 comments

Comments

@tillinb
Copy link

tillinb commented Jun 9, 2023

I am trying to use the "responsive item size" for displaying a form with conditional fields inside a masonry layout. So the form has two levels of YES/NO checkboxes – the rest of the form (and therefore the length and height of the content of the grid-item) depends on the choices made by the user.
For now my test case for this scenario would be this:

https://codepen.io/desandro/pen/DGmpee

I get it to work half way – but I probably run against a similar wall as described in issue #1000:

"Looks like the problem is how the height is being set. The animated item sizes demo works by explicitly setting expanded sizes in CSS. With your demo, since it uses images with varying height, we can't use the same technique. One solution would be to calculate the height in JS." (#1000)

So whenever I click on one option in the form, the grid-item height is re-calculated, the layout adapts the new height. But the problem is that currently the height keeps adding more and more height with every new click event.

So coming back to the suggestion "One solution would be to calculate the height in JS" – i just don't know where and how to calculate the new height and where and how to apply it to the test case "responsive item size". Or to ask the other way round: Is there any working example, where the grid item's height is calculated and applied to the layout after a click on an elementt residing inside that grid-item? Thank you very much! t

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

No branches or pull requests

1 participant