Skip to content

Commit

Permalink
fix(input): remove background on input when required
Browse files Browse the repository at this point in the history
`box-shadow: none` was not working correct with input autofocus
  • Loading branch information
dawidzarzycki committed Jul 9, 2021
1 parent c40bddb commit f4d3642
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exports[`Input renders with an input 1`] = `
}
.c0:-webkit-autofill {
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-border: none;
}
Expand All @@ -39,7 +40,8 @@ exports[`Input renders with an input 1`] = `
.c0:invalid,
.c0:required {
box-shadow: none;
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
}
<input
Expand Down
4 changes: 3 additions & 1 deletion src/__experimental__/components/input/input.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const StyledInput = styled.input`
width: 30px;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-border: none;
}
Expand All @@ -36,7 +37,8 @@ const StyledInput = styled.input`
`}
&:invalid, &:required {
box-shadow: none;
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
}
${({ readOnly, theme }) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ exports[`SimpleColorPicker renders as expected 1`] = `
}
.c6:-webkit-autofill {
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-border: none;
}
Expand All @@ -195,7 +196,8 @@ exports[`SimpleColorPicker renders as expected 1`] = `
.c6:invalid,
.c6:required {
box-shadow: none;
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
}
.c7 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exports[`Textarea when rendered should render default 1`] = `
}
.c7:-webkit-autofill {
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-border: none;
}
Expand All @@ -39,7 +40,8 @@ exports[`Textarea when rendered should render default 1`] = `
.c7:invalid,
.c7:required {
box-shadow: none;
box-shadow: 0 0 0px 1000px #fff inset;
-webkit-box-shadow: 0 0 0px 1000px #fff inset;
}
.c4 {
Expand Down

0 comments on commit f4d3642

Please sign in to comment.