User tests: Successful: Unsuccessful:
Pull Request for Issue #36533 [Solves 1/3 reported problems, the thumbs and the streaming/paginated response are still valid... ].
npm ci
or d/l the package from githubimages
folderAll images fetched immediately
Images are fetched as they enter the viewport
No
Ping @laoneo @Fedik @crystalenka
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_media NPM Change JavaScript |
Labels |
Added:
NPM Resource Changed
?
|
Should we not just add the
loading="lazy"
attribute to the image tag as the dimensions are available for the images. We should use the platform as much as possible said once a Joomla JS developer (can't remember his name? ).
There are no img tags in the media manager currently - all images are loaded as background images of div elements.
What is the benefit of loading them as background images?
We should use the platform as much as possible said once a Joomla JS developer (can't remember his name
? ).
This sounds obnoxious. Why would you ever want to use the browser's provided APIS instead of building them again and having a gazillion of bugs?
Joke apart the loading=lazy
is an attribute for the img element and as @crystalenka already mentioned the design is asking for a style="background-image: ..."
What is the benefit of loading them as background images?
No alt (obviously this is an a11y problem) and it was easier to style/append the edit buttons/checkbox on top (?)
I have absolutely no idea, it seems inefficient to me but I'm not sure. Just commenting why lazy loading wouldn't work as the media manager works now.
No alt (obviously this is an a11y problem) and it was easier to style/append the edit buttons/checkbox on top (?)
How wonderful it would be to manage alt text globally! But this is beyond the scope of this issue/pr, haha.
I am happy to help style the edit buttons over the top of inline images if that is more efficient/a necessary change.
Category | Administration com_media NPM Change JavaScript | ⇒ | Administration com_media NPM Change JavaScript Repository |
Ok, switched to the image tag and used the loading attribute. The styling is a bit of but some object-fit: contain;
or something similar should get us back to the previous state (design-wise). @crystalenka @laoneo
Title |
|
I'll test this and check styling later today or tomorrow. Thank you!!
Additionally has the image container not the same dimensions as the folders:
Yes, switching to the image element needs some scss fixes
I first test shows the attributes loading, width and height in the image. But they are loaded initially in the network tab on FF and chrome.
If you roll to 87d01f8 you'll see that the intersectionObserver is a better fit here. The reason is that there's something weird with the zoom-in/out functionality that triggers the browser to always consider more images in the viewport than what's actually there. Didn't spend any time figuring out what's triggering this (container or item size, or anything else)
The reason is that there's something weird with the zoom-in/out functionality that triggers the browser to always consider more images in the viewport than what's actually there. Didn't spend any time figuring out what's triggering this (container or item size, or anything else)
Pretty sure you can fix this
I have tested this item
If you add the following CSS rules to .image-cropped it fixes the styling issue in modern browsers:
aspect-ratio: 1/1;
object-fit: contain;
Aspect ratio is supported in most recent releases of most modern browsers (https://caniuse.com/?search=aspect-ratio), I'm not sure what J4 is supposed to support but if necessary I can do this a different way. This is just the most future-proofed way to do it.
Title |
|
Title |
|
Labels |
Added:
?
Removed: ? |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-02 20:22:10 |
Closed_By | ⇒ | dgrammatiko |
Should we not just add the? ).
loading="lazy"
attribute to the image tag as the dimensions are available for the images. We should use the platform as much as possible said once a Joomla JS developer (can't remember his name