aFarkas / lazysizes

High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
MIT License
17.51k stars 1.73k forks source link

No way to specify source (No ShadowDom support!) #611

Open tylercrocker opened 5 years ago

tylercrocker commented 5 years ago

So this feels like really basic functionality that should exist now... but I noticed there is no way to specify a source to search for lazy load elements in. It's just hard-coded to search in document. This means that anything I have in a web component's shadow dom will be entirely missed, and there's no way to configure a new instance to delve into a shadow dom.

I'm going to start working on a PR to add this functionality in, but does anyone have any insight into this?

mxswat commented 4 years ago

Are there any updates?

aFarkas commented 4 years ago

@mxswat Sorry no. In short providing an API where you can switch the document would be probably easy, but providing an API where we would have to support multiple documents/shadowroots would be quite hard without sacrificing either performance or filesize.

mxswat commented 4 years ago

Thank you for the answer I'm a bit disappointed because I really wanted to use lazy sizes in one of my web components