eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.44k stars 145 forks source link

ImagesLoaded not working on background-images #121

Closed riccardolardi closed 6 years ago

riccardolardi commented 6 years ago

Is there a way to tell ImagesLoaded to also trigger on background-images?

afram commented 6 years ago

@alberto2000 currently the background images feature of the imagesloaded library is not used.

We'd have to change this component to support it.

riccardolardi commented 6 years ago

afaik it's just an option, can it just be enabled by default?

afram commented 6 years ago

That's changing the current behaviour, so I'm a bit hesitant as it's not backwards compatible and technically should be a breaking change version bump (major version).

imagesloaded doesn't have this feature on by default either. I think a better design would be to allow end users to provide config for imagesloaded (in a backwards compatible way of course).

riccardolardi commented 6 years ago

Totally agree. Why not let users provide the config for imagesloaded to the react-masonry component?

afram commented 6 years ago

Yeah that's what I'm thinking too

afram commented 6 years ago

@alberto2000 can you please try with this pre-release version?

npm install -S react-masonry-component@pre-6.1.0

The ReadMe for this version is available here: https://github.com/eiriklv/react-masonry-component/tree/imagesloaded-config#images-loaded-options

riccardolardi commented 6 years ago

@afram did you just release 6.1.0 upstream? Did a npm update in my project and it fetched react-masonry-component@6.1.0. Thanks a lot, will try it later today

afram commented 6 years ago

I have only released as a pre-release.

If you npm install you should get the version tagged as latest (6.0.2). npm update will then give you 6.1.0. Perhaps I should have tagged it as next instead.

Please let me know how you get on and then I can release it to latest.

riccardolardi commented 6 years ago

Hey, sorry for the late reply. It works great!

afram commented 6 years ago

great thanks. 6.1.1 published.