-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix(input): do not float label because of slotted items #29948
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Changed the visual removal of slotted items to use 'visibility: hidden' to prevent changing the input component's size where 'display: none' could change the size. |
@tanner-reits any news? when will it be merged? |
Hey @ErikOnBike Thanks for taking a stab at this! Unfortunately, hiding the slotted content until focus doesn't match the designs for Material Design (see demo here). We have a task to look into this internally, but I'm not sure when we'll be able to do so if you want to try to match that behavior. |
Hi @tanner-reits, You're completely right. I think I mixed up two issues and tried to solve both in one go. (Not very sensible ;-) |
Issue number: resolves #28665
What is the current behavior?
The input label is floating if an element is slotted. This is especially annoying if a password toggle is present, since it will start floating the label (even when no input is available).
What is the new behavior?
A label will only float (if specified and) if it has a value or received focus.
Does this introduce a breaking change?
Other information
Screenshot before:
Screenshot after:
This issue also seems to fix issue #29449