haltu / muuri

Infinite responsive, sortable, filterable and draggable layouts
https://muuri.dev
MIT License
10.74k stars 644 forks source link

[question] how to update grid container when adjusting padding to items #382

Open dovdovrandom opened 4 years ago

dovdovrandom commented 4 years ago

i have a button that toggles a class on the .board-item-content items, to lower their padding (as an option to condense the screen real estate..)

however, when it adjusts the padding, it doesnt resize the container automatically. How can i achieve this result? ty!

What happens: image

What should happen: image

niklasramo commented 4 years ago

Have you tried calling grid.refreshItems().layout() after the dimensions of items have changed?

dovdovrandom commented 4 years ago

@niklasramo

Yes, i did.

not sure why its not working...

niklasramo commented 4 years ago

@dovdovrandom Can you post a live codepen demo for example? I doubt anyone can help you out without a live demo.