Dirk67
this is just a suggest/wish for a future (J4) version of Modals:
I experimented with (browser based) "native lazy loading" for the <img> tag of the thumbnails
( <img loading="lazy" alt="" src="..." > )
( good explanation here:
web.dev/browser-level-image-lazy-loading/
)
This can be useful in some scenarios especially in the gallery use-case of modals
where I have huge galleries with a lot of thumbnails (100+) on a single page.
For users with poor internet bandwidth (e.g. mobile use) it speeds up the page load ("first rendered impression") a lot with modern actual browsers...
(only the very few images that are visible in the viewport are loaded first)
As a quick "hack" I just added a one-liner to the file ".../plugins/system/modals/src/ImageTraits.php":
$this->attributes->loading ='lazy';
and was able to test it this way.
-------
so my suggest/wish for a future (J4) version of Modals would be
to make a setting in the backend to switch on/off this additional lazy-load attribute for the thumbnails,
or maybe just for the gallery mode (?)