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

[InputLabel] Fix shrunk label click not focusing input #16215

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/material-ui/src/InputBase/InputBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ export const styles = theme => {
'&$disabled': {
opacity: 1, // Reset iOS opacity
},
'&:-webkit-autofill': {
// hack to disable background-color. By making the transition slow we
// create the illusion no background-color is applied at all
'transition-delay': '4815162342s',
},
},
/* Styles applied to the `input` element if `margin="dense"`. */
inputMarginDense: {
Expand Down
9 changes: 0 additions & 9 deletions packages/material-ui/src/InputLabel/InputLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ export const styles = theme => ({
},
/* Styles applied to the root element if `variant="filled"`. */
filled: {
// Chrome's autofill feature gives the input field a yellow background.
// Since the input field is behind the label in the HTML tree,
// the input field is drawn last and hides the label with an opaque background color.
// zIndex: 1 will raise the label above opaque background-colors of input.
zIndex: 1,
pointerEvents: 'none',
transform: 'translate(12px, 20px) scale(1)',
'&$marginDense': {
transform: 'translate(12px, 17px) scale(1)',
Expand All @@ -68,9 +62,6 @@ export const styles = theme => ({
},
/* Styles applied to the root element if `variant="outlined"`. */
outlined: {
// see comment above on filled.zIndex
zIndex: 1,
pointerEvents: 'none',
transform: 'translate(14px, 20px) scale(1)',
'&$marginDense': {
transform: 'translate(14px, 12px) scale(1)',
Expand Down