Skip to content

Responsive images not working as expected in Safari and IE Edge 18+ #15215

@tomgenoni

Description

@tomgenoni

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When using responsive images in React, Safari v12.0.3 and IE Edge v18 request and download the image provided in both the <source> and the <img> fallback.

<picture>
     <source type="image/jpeg" sizes="500px" srcSet="2000.jpeg 2000w" />
     <img alt="test case" sizes="500px" src="fallback.jpeg" />
</picture>

If the current behavior is a bug, please provide the steps to reproduce

Load the examples below in Safari v12 and inspect the Network > Image tab.

HTML (Expected)

html
Example: https://safari-responsive-image-html.netlify.com/
Source: https://github.com/tomgenoni/safari-responsive-image-html

React

react
Example: https://safari-responsive-image-react.netlify.com/
Source: https://github.com/tomgenoni/safari-responsive-image-react

What is the expected behavior?

  • Safari and Edge should only request and download the image provided in the <source>. Safari and Edge work as expected loading the HTML example.
  • Chrome 73 and Firefox 66 already work as expected in both the HTML and React examples.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

"react": "^16.8.5",
"react-dom": "^16.8.5",
"react-scripts": "2.1.8"
  • Browsers affected are Safari on macOS and iOS and IE Edge 18, Windows 10.
  • I don't know if this worked in previous versions of React.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions