Skip to content

Commit a102b2a

Browse files
committed
fix(cdk/text-field): fix autofill listener on Chrome 80
1 parent 555037a commit a102b2a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/cdk/text-field/_text-field.scss

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
@keyframes cdk-text-field-autofill-end {/*!*/}
99

1010
.cdk-text-field-autofill-monitored:-webkit-autofill {
11-
animation-name: cdk-text-field-autofill-start;
11+
// In Chrome 80 we need a 1ms delay, or the animationstart event won't fire.
12+
animation: cdk-text-field-autofill-start 0s 1ms;
1213
}
1314

1415
.cdk-text-field-autofill-monitored:not(:-webkit-autofill) {
15-
animation-name: cdk-text-field-autofill-end;
16+
// In Chrome 80 we need a 1ms delay, or the animationstart event won't fire.
17+
animation: cdk-text-field-autofill-end 0s 1ms;
1618
}
1719

1820
// Remove the resize handle on autosizing textareas, because whatever height
@@ -49,13 +51,14 @@ $cdk-text-field-autofill-color-frame-count: 0;
4951
}
5052

5153
&:-webkit-autofill {
52-
animation-name: cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count};
53-
animation-fill-mode: both;
54+
animation: cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
5455
}
5556

5657
&.cdk-text-field-autofill-monitored:-webkit-autofill {
57-
animation-name: cdk-text-field-autofill-start,
58-
cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count};
58+
// In Chrome 80 we need a 1ms delay for cdk-text-field-autofill-start, or the animationstart
59+
// event won't fire.
60+
animation: cdk-text-field-autofill-start 0s 1ms,
61+
cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
5962
}
6063

6164
$cdk-text-field-autofill-color-frame-count:

0 commit comments

Comments
 (0)