beekai-oss / react-simple-img

🌅 React lazy load images with IntersectionObserver API and Priority Hints
MIT License
989 stars 41 forks source link

Move `noscript` position and add `imgStyle` into fallback `<img />` #66

Closed elrumordelaluz closed 5 years ago

elrumordelaluz commented 5 years ago

Hey @bluebill1049, first of all thanks for this cool library.

I found some issues regarding the <noscript> part and hope could be useful for every use case.

The point is that checking the cases where <noscript> should be available as fallback, since is rendered after the regular <img />, both as relative positioned elements, the fallback one remains outside the wrapper which has overflow: hidden styles. Swapping the order, in that case, the regular img (not needed) remains overflown.

The other point is to pass also imgStyles to the fallback img to have the same look and feel as the regular one.

Let me know in any case,

bluebill1049 commented 5 years ago

nice @elrumordelaluz thank you very much for the PR, I will a quick test and get it in tonight :)