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

Positions of items are not correct initially #36

Open
RedFour opened this issue Feb 2, 2017 · 5 comments
Open

Positions of items are not correct initially #36

RedFour opened this issue Feb 2, 2017 · 5 comments

Comments

@RedFour
Copy link

RedFour commented Feb 2, 2017

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?

@arsyed04
Copy link

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

@arsyed04
Copy link

Any update on the issue?

@LongPotato
Copy link

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

@LongPotato
Copy link

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

@vugar005
Copy link

vugar005 commented Nov 3, 2017

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!

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.1/imagesloaded.pkgd.min.js"></script>

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

4 participants