[Select][FormControl] Make outlined variant the default one#24895
[Select][FormControl] Make outlined variant the default one#24895oliviertassinari merged 13 commits intomui:nextfrom
Conversation
True. I think that most developers use the composed version ( |
dddd7c0 to
1a70f5f
Compare
|
Or modify it to support both use-cases |
42b54d9 to
349a9ed
Compare
|
@mbrookes @oliviertassinari I need your advice on how to scope this changeset. This change seems to be triggering multiple related ones. Here's what I am seeing so far: The With that in mind, I see two possibilities: A) Change the default variant of the B) Change the default variant of <FormControl ...>
... <Input />
</FormControl>From what I see, for the above to look correct, Maybe there's C) another approach? FWIW, I am very supportive of outphasing the |
|
B) Sounds like the best way to go. It does involve diving into multiple parts of the codebase. |
|
@petyosi How is the effort going? Did you face a blocker? |
|
Hey, sorry for the delay, Working through the screenshot differences, I will push an update for review this week. |
81b40df to
713d4cf
Compare
|
@mbrookes @oliviertassinari Please take a look, thanks! |
mnajdova
left a comment
There was a problem hiding this comment.
The changes look great. One thing I am not sure about is, whether the standard variant should still be named standard as it is not a default value. I feel like maybe we should rename to something like underlined variant (or anything else that is not standard, as it not being default value means it is not standard :))
| export default function TextFieldComponent(props) { | ||
| return ( | ||
| <div> | ||
| <TextField {...props} variant="standard" /> |
There was a problem hiding this comment.
| <TextField {...props} variant="standard" /> | |
| <TextField variant="standard" {...props} /> |
Shouldn't this be the result? Otherwise, we are always overriding any variant being part of props. The same would be applied to the other components if this is correct.
There was a problem hiding this comment.
Your comment seems correct to me - the codemod was originally introduced by @mbrookes and I basically multiplied it.
There was a problem hiding this comment.
Ah I see, ok let's consider fixing it in a separate PR.
@mnajdova If I recall correctly, the name originates from when we introduced the filled, and outlined variant. It likely has this meaning:
https://dictionary.cambridge.org/dictionary/english/standard It doesn't age well if it's not the default, agree. Should it be enough to make a breaking change? I guess we have to weigh the cost. cc @mbrookes. In any case, I think that it's outside the scope of this PR and should concern a potential follow-up. Personally, I think that it would cost a lot for some value, maybe not enough. |
Agree, it is definitely out of the scope of this PR, just thought to mention it as we are making the changes now. So far developers were never typing Let me update the branch with the latest changes, so we can take a look on the changes & visual regressions better. |
| : classes, | ||
| ...(input ? input.props.inputProps : {}), | ||
| }, | ||
| ...(multiple && variant === 'outlined' ? { notched: true } : {}), |
There was a problem hiding this comment.
Is there more context on this change?
There was a problem hiding this comment.
without the notched prop, the label was strike through the fieldset border. My guess is that this has always been the case, but the combination (outlined + multiple) was never visible.
There was a problem hiding this comment.
Good catch on the first one. I was trying to fix the native + multiple + outlined combo. Pushed a fix.
The second one is not related. It is "right" I believe, although it does not look very well. The example itself is quite extreme, as the width is very small (I guess in order to test the wrapping of the chips).
|
One more BC done 🙏 @petyosi thanks |


Breaking changes
[Select] Change default variant from standard to outlined ([Select][FormControl] Make outlined variant the default one #24895) @petyosi
Standard has been removed from the Material Design guidelines. This codemod will automatically update your code.
[FormControl] Change default variant from standard to outlined ([Select][FormControl] Make outlined variant the default one #24895) @petyosi
Standard has been removed from the Material Design guidelines. This codemod will automatically update your code.
Change the default variant from standard to outlined. Rationale in Material Studies: Text Fields. Done for TextField in #23503.
One of #20012
Checklist:
SelectcomponentChange the default variant of thebetter be done in a separate PR, not a small thing, IMONativeSelectcomponentvariantusage of theFormControland see if it is safe to change itChangedocs/pages/api-docs/select.json(or maybe it is generated?)variant="outlined"propsvariant="standard"to selects who had no variant before<TextField select>@mbrookes - please let me know if I am missing something from the above. FWIW, the biggest inconvenience of the outlined Select is that the
labelprop value should match theInputLabeltext.