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

[TextField] Fix floating label position #36288

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Feb 21, 2023

I noticed this while I was checking out mui/toolpad#1695, something was looking off visually with the Name input:

Screenshot 2023-02-21 at 22 34 18

as it turns out, the label displayed and the label used for the gutter in the outline don't match:

With this change, it feels better, the gap is more consistent 😌

Screenshot 2023-02-21 at 22 36 39

I checked a bit the history, it was first spotted in #29630 (comment).

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer labels Feb 21, 2023
@mui-bot
Copy link

mui-bot commented Feb 21, 2023

Netlify deploy preview

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

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 1e793e5

@oliviertassinari oliviertassinari changed the title [TextField] Fix floating label positon [TextField] Fix floating label position Feb 22, 2023
@oliviertassinari oliviertassinari added the package: material-ui Specific to @mui/material label Feb 22, 2023
@@ -184,7 +184,7 @@ const OutlinedInput = React.forwardRef(function OutlinedInput(inProps, ref) {
label != null && label !== '' && fcs.required ? (
<React.Fragment>
{label}
&nbsp;{'*'}
&thinsp;{'*'}
Copy link
Member

Choose a reason for hiding this comment

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

👏

Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

Looks good!

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: text field This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants