-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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] Revert visual regressions from #42283 #43364
Merged
DiegoAndai
merged 9 commits into
mui:next
from
ZeeshanTamboli:issue-43185-textflow-overflowing-container
Aug 20, 2024
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1a81f57
add maxWidth to TextField
ZeeshanTamboli f5e2a5c
Add visual regression test for constrained TextField
ZeeshanTamboli bb2a213
merge next branch and resolve conflixt
ZeeshanTamboli 380106a
add commet ot test
ZeeshanTamboli d203297
Merge branch 'next' into issue-43185-textflow-overflowing-container
ZeeshanTamboli 53ac5b6
Revert InputBase change
DiegoAndai 8f07633
Revert StepLabel change and add test
DiegoAndai ebf0bd1
prettier
DiegoAndai 7f80d96
eslint
DiegoAndai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/regressions/fixtures/TextField/ConstrainedTextField.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import TextField from '@mui/material/TextField'; | ||
|
||
// TextField shouldn't overflow the red bordered container | ||
export default function ConstrainedTextField() { | ||
return ( | ||
<div | ||
style={{ | ||
width: 100, | ||
border: '1px solid red', | ||
}} | ||
> | ||
<TextField label="Outlined" variant="outlined" /> | ||
</div> | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reasoning behind adding this to
TextField
vs.FormControl
vs.InputBase
? I'm not fully familiar with this abstraction hierarchy.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want
maxWidth: 100%
to be applied directly to theTextField
root because it's the component that's immediately impacted by the container's size. While you might consider applying it toFormControl
, whichTextField
inherits,FormControl
is primarily responsible for form-related context (like labels and helper text) which Text field also supports and not for the direct sizing or spacing ofTextField
. AddingmaxWidth: 100%
toFormControl
could create unintended side effects for other form controls.As for
InputBase
, it's used by other components likeSelect
. ApplyingmaxWidth: 100%
there would impact all components that rely onInputBase
, potentially causing layout issues where this behavior isn't needed. And it won't even fix the issue because it is not a direct child of the container.TextField
is a higher-level component that combinesInputBase
andFormControl
, providing a simplified API for common use cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation