angular2-masonry icon indicating copy to clipboard operation
angular2-masonry copied to clipboard

Positions of items are not correct initially

Open RedFour opened this issue 8 years ago • 5 comments

When the page initially loads, all items are in the right column and order, but are stacked on top of each other in an offset. It takes me clicking on an item to trigger a transition where all the items are placed properly. The grid then continues to work as I add or remove items.

<masonry>
	<masonry-brick *ngFor="let key of myKeys" class="brick">
		<my-item [itemKey]="key"></my-item>
	</masonry-brick>
</masonry>

.brick { 
	width: 25%; 
}

screenshot of items overlapping

Is there some option I need to set so that it puts images in the correct position in the initial load?

RedFour avatar Feb 02 '17 23:02 RedFour

I agree, this is concerning issue. Needs urgent fix.

arsyed04 avatar Feb 19 '17 19:02 arsyed04

Any update on the issue?

arsyed04 avatar Apr 29 '17 14:04 arsyed04

I set the option [useImagesLoaded]="true", it solved this issue, but it also messed up the order of the list.

LongPotato avatar May 04 '17 23:05 LongPotato

I used setTimeout and _msnry.reloadItems() mentioned in #10 to work around it.

LongPotato avatar May 05 '17 00:05 LongPotato

I also encountered same problem.So here is solution:

  1. add attribute [useImagesLoaded]="true" like

<masonry [useImagesLoaded]="true">

2.Add this script to index.html otherwise it wont work!

vugar005 avatar Nov 03 '17 07:11 vugar005