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][FormcontrolLabel] Fix applying slotProps.typography #42278

Closed
wants to merge 5 commits into from

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented May 17, 2024

closes #42277

@sai6855 sai6855 added bug 🐛 Something doesn't work package: material-ui Specific to @mui/material component: FormControl The React component labels May 17, 2024
@mui-bot
Copy link

mui-bot commented May 17, 2024

Netlify deploy preview

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 774500c

@@ -173,7 +173,7 @@ const FormControlLabel = React.forwardRef(function FormControlLabel(inProps, ref
externalForwardedProps,
ownerState,
});

delete typographySlotProps.ownerState;
Copy link
Contributor Author

@sai6855 sai6855 May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR we avoided deleting ownerState and went with fixing spreading of ownerState in Typograpghy for passing slotProps correctly (PR -> #41903 ).

But fixing spreading of ownerState didn't fully fixed passing slotProps issues, as we can still see the issue mentioned in PR description, so i'm again reverting to this approach.

I believe root cause for ownerState issues are tracked here #42184

@sai6855 sai6855 requested a review from DiegoAndai May 17, 2024 12:19
@sai6855 sai6855 changed the title [material-ui][FormcontrolLabel] Fix applying slotProps.typography [material-ui][FormcontrolLabel] Fix applying slotProps.typography correctly May 17, 2024
@@ -331,4 +331,23 @@ describe('<FormControlLabel />', () => {

expect(getByTestId('control')).to.have.attribute('value', 'test');
});

it('label should have noWrap styles', function test() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test for the fix

@sai6855 sai6855 changed the title [material-ui][FormcontrolLabel] Fix applying slotProps.typography correctly [material-ui][FormcontrolLabel] Fix applying slotProps.typography May 17, 2024
@sai6855
Copy link
Contributor Author

sai6855 commented May 17, 2024

Not sure about argos issue, i don't think it's related to this PR (even on merging latest next branch, argos issue didn't fixed)

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: FormControl The React component package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui][FormControlLabel] slotProps.typography not applied correctly
2 participants