Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Properly support srcSet in the c-image component #422

@MWFIAE

Description

@MWFIAE

Is your feature request related to a problem? Please describe.
I'm trying to optimize our site for mobile users. Using responsive images via nuxt-responsive-loader.
While this seems to work fine in the first moment. I realized it actually loaded 2 image versions.
After digging the code I saw that chakra image uses a virtual image in it's code to detect if it should display the fallback image instead.
However this virtual image doesn't take the srcset into account. Which means it directly loads the src image. (Which I provided additionally as a fallback for older browsers)

Describe the solution you'd like+
Give the c-image component proper srcset support by also giving the virtual img the srcset attribute.

Additional context
Screenshot of the network tab showing that more than 1 image was loaded.
image

Example coding for one image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions