Problem/Motivation

The loading attribute is rendered regardless the native lazy-loading is selected or not.

Steps to reproduce

Review rendered HTML. Observe loading=“lazy” attribute.

Proposed resolution

Render the attribute only when native lazy-loading is selected.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

osman created an issue. See original summary.

  • osman committed e8b7e8f on 3.x/3182590
    Issue #3182590 by osman: Render `loading=“lazy”` only when native lazy-...

  • osman committed e8b7e8f on 8.x-3.x
    Issue #3182590 by osman: Render `loading=“lazy”` only when native lazy-...
osman’s picture

Status: Active » Fixed
osman’s picture

With this update now, the image and iframe markups respect the "Prefer native lazy-loading" option more accurately.

When "Prefer native lazy-loading" option is selected, only a loading=“lazy” attribute is added to the image and iframe tags; no lazysizes javascript library is loaded.

When that option is not checked, the loading=“lazy” attribute is no longer added. All necessary attribute changes are done on the server-side.

The changes apply to both image fields, and text-formats.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.