I’m trying to use the loading attribute on an html.Img to configure image lazy loading, but it does not seem to be supported. No mention of it in the docs or anything. I’m working with dash 2.7.1.
Can sort of work around by using dash-dangerously-set-html but the DangerouslySetHtml component there isn’t serialisable so I can’t cache anything which uses this under the hood.
Am I missing something which lets me do this easily?
That doesn’t quite fit my usecase sadly, i’m dynamically loading a bunch of images which won’t all be visible on the screen immediately so I only want to load them when they are scrolled into view. And obviously I don’t really want to try and replicate that lazy loading logic myself through callbacks or javascript.
Is it possible to try and get the loading attribute added to the html.Img component? (obviously not a quick solution but seems like a reasonable feature request). I’m happy to try and help if resourcing is an issue.
Alternatively figuring out how to get the DangerouslySetHtml component serialisable in a similar fashion to other dash components would also potentially be useful, though I don’t currently know enough about how that works to know if viable or not.