mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(core): handle undefined CSS time values in parseCssTimeUnitsToMs function (#64181)
Improve error handling when `rawDelays` contains fewer items than `transitionedProperties`, preventing a toLowerCase of undefined error in `parseCssTimeUnitsToMs`. PR Close #64181
This commit is contained in:
parent
b22f73d54f
commit
cb56fbfddb
1 changed files with 2 additions and 1 deletions
|
|
@ -10,7 +10,8 @@ import {LView} from '../render3/interfaces/view';
|
|||
import {LongestAnimation} from './interfaces';
|
||||
|
||||
/** Parses a CSS time value to milliseconds. */
|
||||
function parseCssTimeUnitsToMs(value: string): number {
|
||||
function parseCssTimeUnitsToMs(value: string | undefined): number {
|
||||
if (!value) return 0;
|
||||
// Some browsers will return it in seconds, whereas others will return milliseconds.
|
||||
const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;
|
||||
return parseFloat(value) * multiplier;
|
||||
|
|
|
|||
Loading…
Reference in a new issue