Skip to content

Commit e402c6c

Browse files
committed
fix(input): don't animatie label when value is set programmatically
1 parent 2dbf87c commit e402c6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib/input/input-container.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ $mat-input-underline-disabled-background-image:
105105
// Assumes the autofill is non-empty.
106106
&:-webkit-autofill + .mat-input-placeholder-wrapper .mat-float {
107107
@include mat-input-placeholder-floating;
108+
transition: none;
108109
}
109110

110111
// Note that we can't use something like visibility: hidden or
@@ -160,6 +161,12 @@ $mat-input-underline-disabled-background-image:
160161
}
161162
}
162163

164+
// Disable the placeholder animation when the input is not empty (this prevents placeholder
165+
// animating up when the value is set programmatically).
166+
.mat-input-placeholder:not(.mat-empty) {
167+
transition: none;
168+
}
169+
163170
// Used to hide the placeholder overflow on IE, since IE doesn't take transform into account when
164171
// determining overflow.
165172
.mat-input-placeholder-wrapper {

0 commit comments

Comments
 (0)