desandro / masonry

:love_hotel: Cascading grid layout plugin
https://masonry.desandro.com
16.41k stars 2.11k forks source link

Issue with <details> #1076

Closed GenieTim closed 5 years ago

GenieTim commented 5 years ago

Test case: https://codepen.io/BernhardWebstudio/pen/YdNLKa

With a <details> element in place, Masonry fails to realign on extension of the details-element. Might be a no-fix, in which case I would like to request a documentation adjustment.

desandro commented 5 years ago

Thanks for reporting this issue and providing a test case! If you make a change to the size of an item element, like expanding a details element, you'll have to trigger layout on the details toggle event

$grid.find('details').on( 'toggle', function() {
  $grid.masonry();
});

See demo https://codepen.io/desandro/pen/4fcade9e0d20b359b74a8d78e05e1cf7

GenieTim commented 5 years ago

Alright, thanks!