Setting media field to loading="eager" doesn’t work when using the media_thumbnail field formatter

Created on 1 September 2022, over 2 years ago
Updated 28 March 2023, over 1 year ago

Problem/Motivation

The loading UI appears to be ignored for media images displayed as thumbnail.
When loading is set to eager it still displays as lazy.

Changing loading in /admin/structure/media/manage/image/display to eager does not fix this (nor should it).
Regular image fields work correctly.

The only way I've found to get a media image to display as eager is to set the image loading in /admin/structure/media/manage/image/display. Then use rendered entity rather than thumbnail. But this forces all media that wants to use eager to use the same image style.

Steps to reproduce

  1. Create a new Drupal instance
  2. install the Media Module
  3. Add a media image field to some content
  4. in manage display set the image to thumbnail
  5. open the loading settings for the thumbnail and set it to "eager"
  6. create that content and add an image to it
  7. look at the html for the img and it has the property loading="lazy" instead of "eager"

Proposed resolution

Fix whatever is overriding/ignoring the loading argument in the media image field.

πŸ› Bug report
Status

Fixed

Version

9.5

Component
MediaΒ  β†’

Last updated 4 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States Phoenixbros

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024