question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

handleImagesLoaded triggers multiple times

See original GitHub issue

handleImagesLoaded triggers multiple times, I am using: onLayoutComplete={handleImagesLoaded} with function inside the createClass onLayoutComplete={this.handleImagesLoaded} it triggers 2 times , otherwise its 4 or 5

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
aframcommented, Mar 11, 2017

@arpecop @indapublic I don’t think this is a bug in Masonry or React Masonry Component.

the layoutcomplete event fires every time Masonry completes a layout. Do you find your layout updates several times on screen? This can happen as images are downloaded.

If you want to capture 1 event every X seconds etc, you could try using Lodash’s throttle or debounce functions.

http://masonry.desandro.com/events.html#layoutcomplete

0reactions
MariuzMcommented, Apr 21, 2020

Untitled Here is the illustration of the problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

Appending an onload to an image causes the onload event to ...
When you append an image with a onload function with jQuery, the event gets fired multiple times on Android: $('#element').append('<img src="/ ...
Read more >
Wait Until All Images are Loaded | Sean C Davis
When we begin, assume no images are loaded. var imagesLoaded = 0; // Count the total number of images on the page when...
Read more >
profiles/wcm_base/libraries/jquery.imagesloaded ...
A jQuery plugin that triggers a callback after all the selected/child images have been loaded. Because you can't do .load() on cached images....
Read more >
Picture perfect images with the modern <img> element
[Ed. note: While we take some time to rest up over the holidays and prepare for next year ... Images can impact the...
Read more >
Update Masonry (v3.3.2) & imagesLoaded (v3.2.0) package
It would be good to check how many themes are using imagesloaded when using the masonry handle. // Masonry v2 depended on jQuery....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found