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

[Avatar] Fix support for crossOrigin #27013

Merged
merged 5 commits into from Jul 8, 2021

Conversation

ShirasawaSama
Copy link
Contributor

@ShirasawaSama ShirasawaSama commented Jun 29, 2021

@mui-pr-bot
Copy link

mui-pr-bot commented Jun 29, 2021

Details of bundle changes (experimental)

Generated by 🚫 dangerJS against 7ad72f8

@michal-perlakowski

This comment has been minimized.

@ShirasawaSama
Copy link
Contributor Author

ShirasawaSama commented Jun 29, 2021

You can pass the crossorigin attribute to the img in Avatar without this change:

<Avatar
  alt="Remy Sharp"
  src="https://next.material-ui.com/static/images/avatar/1.jpg"
  imgProps={{ crossOrigin: 'anonymous' }}
/>

https://codesandbox.io/s/imageavatars-material-demo-forked-3o2o6

I've tried that, too. But in Edge 91.0.864.59, it just failed to load.

And report has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

@oliviertassinari oliviertassinari changed the title [core] Add crossOrigin to Avatar [Avatar] Fix support for crossOrigin Jun 29, 2021
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: avatar This is the name of the generic UI component, not the React module! labels Jun 29, 2021
@eps1lon eps1lon self-assigned this Jun 30, 2021
packages/material-ui/src/Avatar/Avatar.js Outdated Show resolved Hide resolved
@eps1lon eps1lon assigned ShirasawaSama and unassigned eps1lon Jun 30, 2021
@ShirasawaSama
Copy link
Contributor Author

@eps1lon Maybe referrerPolicy is also needed by users.

-- https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy

@ShirasawaSama ShirasawaSama removed their assignment Jul 1, 2021
@oliviertassinari oliviertassinari merged commit 972b994 into mui:next Jul 8, 2021
@oliviertassinari
Copy link
Member

@ShirasawaSama Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: avatar This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants