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][TextField] Fix ownerState silent propagation #42345

Closed
wants to merge 1 commit into from

Conversation

DiegoAndai
Copy link
Member

@DiegoAndai DiegoAndai commented May 22, 2024

This is a symptom of #42184. Fixes #42391

Introduced due to #42001 and #42062 being merged in parallel without testing them together. I think this is why Argos didn't catch it.

Bug

https://next.mui.com/material-ui/react-text-field/

Screenshot 2024-05-22 at 15 48 41 Screenshot 2024-05-22 at 15 48 22

Fix

PR preview: Waiting for PR deploy

Benchmark: https://mui.com/material-ui/react-text-field/

Notes

The TextField's intricate ownerState scheme is hard to track and maintain. There are probably bugs similar to these that we didn't catch.

@DiegoAndai DiegoAndai added package: material-ui Specific to @mui/material regression A bug, but worse labels May 22, 2024
@DiegoAndai DiegoAndai self-assigned this May 22, 2024
@mui-bot
Copy link

mui-bot commented May 22, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 796fd6e

@DiegoAndai
Copy link
Member Author

See Argos "failures" for further fixes 😅

@@ -287,6 +287,9 @@ const FilledInput = React.forwardRef(function FilledInput(inProps, ref) {
type,
};

// https://github.com/mui/material-ui/issues/42184
delete ownerState.ownerState;
Copy link
Member

Choose a reason for hiding this comment

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

As the issue comes from

isMatch = variant.props({ ownerState, ...props, ...ownerState });
, should we maybe handle it there instead? Intercept if ownerState.ownerState exists and remove it? I can't find any use-case when we would want to have it.

@DiegoAndai
Copy link
Member Author

Closed in favor of #42358

@DiegoAndai DiegoAndai closed this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: material-ui Specific to @mui/material regression A bug, but worse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrading from 6.0.0-alpha.7 to 6.0.0-alpha.8 breaks styles of TextField
4 participants