Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fix(text-field): Fix textfield placeholder & outline stroke animation (
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiomkar authored Jan 31, 2019
1 parent 9f8ee9e commit 58c3b4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/mdc-notched-outline/mdc-notched-outline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
&__trailing {
box-sizing: border-box;
height: 100%;
transition: border $mdc-notched-outline-transition-duration $mdc-animation-standard-curve-timing-function;
border-top: 1px solid;
border-bottom: 1px solid;
pointer-events: none;
Expand Down
4 changes: 2 additions & 2 deletions packages/mdc-textfield/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@

@import "@material/animation/variables";

@function mdc-text-field-transition($property) {
@return #{$property} 180ms $mdc-animation-standard-curve-timing-function;
@function mdc-text-field-transition($property, $duration: 150ms) {
@return #{$property} #{$duration} $mdc-animation-standard-curve-timing-function;
}
4 changes: 3 additions & 1 deletion packages/mdc-textfield/mdc-text-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
appearance: none;

&::placeholder {
transition: mdc-text-field-transition(opacity);
transition: mdc-text-field-transition(opacity, $duration: 67ms);
opacity: 0;
color: $mdc-text-field-placeholder-ink-color;
}
Expand All @@ -104,6 +104,8 @@
// Always show placeholder for text field without label and show only on focused state when label is present.
.mdc-text-field--no-label &::placeholder,
.mdc-text-field--focused &::placeholder {
transition-delay: 40ms;
transition-duration: 110ms;
opacity: 1;
}

Expand Down

0 comments on commit 58c3b4d

Please sign in to comment.