Skip to content

Commit

Permalink
fix: text input autofill (#125)
Browse files Browse the repository at this point in the history
- prevent browsers from changing background color after autofilling
- ensure label translates after autofilling
  • Loading branch information
uipoet authored Jan 11, 2022
1 parent 503f573 commit c864e7d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/components/input/input.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,19 @@
color: var(--md-color-primary);
}

.input:-webkit-autofill {
transition-delay: 6000s;
transition-property: background-color, color;
}

.container.filled > .input:focus-within + .label,
.container.filled > .input:-webkit-autofill + .label,
.container.filled > .input:not(:placeholder-shown) + .label {
transform: translate3d(0, -1rem, 0);
}

.container.outlined > .input:focus-within + .label,
.container.outlined > .input:-webkit-autofill + .label,
.container.outlined > .input:not(:placeholder-shown) + .label {
background-color: inherit;
left: 0.8rem;
Expand Down

0 comments on commit c864e7d

Please sign in to comment.