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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/mui-material/src/FilledInput/FilledInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.


const classes = useUtilityClasses(props);
const filledInputComponentsProps = { root: { ownerState }, input: { ownerState } };

Expand Down
3 changes: 3 additions & 0 deletions packages/mui-material/src/InputBase/InputBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ const InputBase = React.forwardRef(function InputBase(inProps, ref) {
type,
};

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

const classes = useUtilityClasses(ownerState);

const Root = slots.root || components.Root || InputBaseRoot;
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-material/src/InputLabel/InputLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ const InputLabel = React.forwardRef(function InputLabel(inProps, ref) {
focused: fcs.focused,
};

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

const classes = useUtilityClasses(ownerState);

return (
Expand Down
Loading