Skip to content

Commit

Permalink
fix(input): don't animate label when value is set programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Mar 21, 2017
1 parent 2dbf87c commit fa98c3b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/input/input-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ $mat-input-underline-disabled-background-image:
// Assumes the autofill is non-empty.
&:-webkit-autofill + .mat-input-placeholder-wrapper .mat-float {
@include mat-input-placeholder-floating;
transition: none;
}

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

// Disable the placeholder animation when the input is not empty (this prevents placeholder
// animating up when the value is set programmatically).
.mat-input-placeholder:not(.mat-empty) {
transition: none;
}

// Used to hide the placeholder overflow on IE, since IE doesn't take transform into account when
// determining overflow.
.mat-input-placeholder-wrapper {
Expand Down

0 comments on commit fa98c3b

Please sign in to comment.