-
-
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
[TextField] Chromes auto-fill covers label for outlined TextField #12890
Comments
@PutziSan Thanks for raising! My bad, I have removed this logic. I think that it's generic enough to add it in the InputBase. |
@PutziSan Adding the style here should do it. Do you want to give it a try? |
Okay, cool, I'll send a PR. If there appears further problems in another browser or if the z-index in the label breaks the layout of some users, there are 2 alternatives (I just thought of it and write it down for documentation): We could swap the order of the // ...
select ? (
<Select value={value} input={InputElement} {...SelectProps}>
{children}
</Select>
) : (
InputElement
)}
{label && (
<InputLabel htmlFor={id} ref={this.labelRef} {...InputLabelProps}>
{label}
</InputLabel>
)} We could also leave the input field only as big as it really is and give the container the height/padding. This would look like this (quick&dirty adapted in the browser, doesn't look perfect as it should): |
Do you have an example? |
Custom PopOver-implementations with https://codesandbox.io/s/xo6jqkr5op (the |
material-components-web has also placed the label under the input field, whether it is exactly for this reason or for another, is of course hard to say ;) I think, however, that the |
@PutziSan I'm fine with the z-index, thanks for raising the issues. With that in mind, better put the style in the |
Expected Behavior
The yellow background inserted by chromes auto-fill should not cover the label.
Current Behavior
Chromes auto-fill covers the label
Steps to Reproduce
Link: https://material-ui.com/demos/text-fields/#outlined
Your Environment
possible solution
If I add
z-index: 1
to the label, the problem is solved. Another option is to use the CSS-webkit-autofill-selector, but I am not sure which properties you have to change to make it fitThe text was updated successfully, but these errors were encountered: