Fix a re-render bug with flexmasonry

This commit is contained in:
Michael Lange 2020-10-07 22:18:43 -07:00
parent 066502d408
commit ef12488d1c
2 changed files with 3 additions and 2 deletions

View File

@ -48,7 +48,7 @@ export default class FlexMasonry extends Component {
dc.style.order = index;
});
// Gaurantee column wrapping as predicted (if the first item of a column is shorter than the difference
// Guarantee column wrapping as predicted (if the first item of a column is shorter than the difference
// beteen the height of the column and the previous column, then flexbox will naturally place the first
// item at the end of the previous column).
columns.forEach((column, index) => {

View File

@ -2,7 +2,8 @@
class="flex-masonry {{if @withSpacing "with-spacing"}} flex-masonry-columns-{{@columns}}"
{{did-insert this.captureElement}}
{{did-insert this.reflow}}
{{did-update this.reflow}}>
{{did-update this.reflow}}
{{window-resize this.reflow}}>
{{#each @items as |item|}}
<div class="flex-masonry-item">
{{yield item (action this.reflow)}}