Skip to content

fix(cdk/text-field): fix autofill listener on Chrome 80 #18468

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 2 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

"unit-case": "lower",
"unit-no-unknown": true,
"unit-whitelist": ["px", "%", "deg", "ms", "em", "vh", "vw", "vmin"],
"unit-whitelist": ["px", "%", "deg", "s", "ms", "em", "vh", "vw", "vmin"],

"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
Expand Down
15 changes: 9 additions & 6 deletions src/cdk/text-field/_text-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
@keyframes cdk-text-field-autofill-end {/*!*/}

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

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

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

&:-webkit-autofill {
animation-name: cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count};
animation-fill-mode: both;
animation: cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
}

&.cdk-text-field-autofill-monitored:-webkit-autofill {
animation-name: cdk-text-field-autofill-start,
cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count};
// Since Chrome 80 we need a 1ms delay for cdk-text-field-autofill-start, or the animationstart
// event won't fire.
animation: cdk-text-field-autofill-start 0s 1ms,
cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
}

$cdk-text-field-autofill-color-frame-count:
Expand Down