-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[OutlinedInput] InputLabelProps.shrink=true causes border to run through label #16774
Comments
@chrisparton1991 Interesting, thanks for reporting. I believe that we should be using a layout effet here: Would it work in your case? Do you want to submit a pull request? :) |
@oliviertassinari thanks for the suggestion! I tried It makes sense that setting the width as a layout effect could work, but the CSS transition must already be applied to the element before the layout effect runs. |
Or possibly because |
I don't understand why it doesn't work. We use a similar approach with https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/NoSsr/NoSsr.js. |
Perhaps the difference is that, in My theory is that the I'm by no means an expert on hooks though, so I could very well be wrong! |
We have explored a CSS pure implementation in #17680. It should solve the problem. |
Expected Behavior 🤔
An input that is force shrunk should not have the border intersecting with the label text.
Current Behavior 😯
On creation, the border cuts through the label text, and animates to the correct display.
Steps to Reproduce 🕹
Link: https://codesandbox.io/s/grid-pw67o
I think the solution is to omit this NotchedOutline transition when a label is set to shrink.
Context 🔦
I have a form that appears when items are clicked. The inputs all exhibit this effect.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: