lazysizes icon indicating copy to clipboard operation
lazysizes copied to clipboard

No way to specify source (No ShadowDom support!)

Open tylercrocker opened this issue 6 years ago • 3 comments
trafficstars

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?

tylercrocker avatar Mar 06 '19 21:03 tylercrocker

Are there any updates?

mxswat avatar Jun 15 '20 21:06 mxswat

@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.

aFarkas avatar Jun 16 '20 05:06 aFarkas

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

mxswat avatar Jun 17 '20 22:06 mxswat