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

[material-ui][Avatar] Fix slotProps.img not spread to hook #44536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Nov 25, 2024

closes #44501

before: https://codesandbox.io/p/sandbox/avatar-imgprops-demo-7jdnp5
after: https://codesandbox.io/p/sandbox/material-ui-cra-ts-forked-l9rtth

The problem is slotProps.img is not spread to the useLoaded hook inside Avatar, so the crossOrigin does not take into account.

It's not possible to test without mocking the useLoaded hook.

@siriwatknp siriwatknp added the bug 🐛 Something doesn't work label Nov 25, 2024
@mui-bot
Copy link

mui-bot commented Nov 25, 2024

Netlify deploy preview

https://deploy-preview-44536--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 2494ca3

@DiegoAndai
Copy link
Member

It's not possible to test without mocking the useLoaded hook.

Can we mock it to add a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avatar component has imgProps marked as deprecated but the suggested alternative does not work
3 participants