Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-plugin-image): pass down missing sizes attribute to <sources> (fixes #29093) #29092

Merged

Conversation

Grsmto
Copy link

@Grsmto Grsmto commented Jan 19, 2021

Description

The new gatsby-plugin-image currently does not pass down the sizes prop to the <source> element, which cause the highest image to always be chosen by the browser. Only passing it to <img> is not sufficient.
By passing it down, the browser can now properly choose the right image based on the sizes property.

Also, the previous gatsby-image was working this way, so this is simply a bug fix and nothing more.

Related Issues

#29093

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 19, 2021
@Grsmto Grsmto changed the title fix(gatsby-plugin-image): pass down missing sizes attribute to <sources> fix(gatsby-plugin-image): pass down missing sizes attribute to <sources> (fixes #29093) Jan 19, 2021
@ascorbic
Copy link
Contributor

Thank you! Good spot.

@ascorbic ascorbic merged commit 2e42197 into gatsbyjs:master Jan 20, 2021
@ascorbic ascorbic added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 20, 2021
vladar pushed a commit that referenced this pull request Jan 20, 2021
gatsbybot pushed a commit that referenced this pull request Jan 20, 2021
…es> (#29092) (#29108)

(cherry picked from commit 2e42197)

Co-authored-by: Adrien Denat <[email protected]>
@vladar
Copy link
Contributor

vladar commented Jan 20, 2021

Published in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants