Skip to content

fix(input): don't animate label when value is set programmatically #3691

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

Merged
merged 1 commit into from
Mar 27, 2017
Merged
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
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