fix(transition): handle possible auto value for transition/animation durations

close #8409
This commit is contained in:
Evan You 2023-06-14 12:12:22 +08:00
parent 1f83020a2b
commit 96c76facb7
1 changed files with 2 additions and 0 deletions

View File

@ -445,6 +445,8 @@ function getTimeout(delays: string[], durations: string[]): number {
// If comma is not replaced with a dot, the input will be rounded down
// (i.e. acting as a floor function) causing unexpected behaviors
function toMs(s: string): number {
// #8409 default value for CSS durations can be 'auto'
if (s === 'auto') return 0
return Number(s.slice(0, -1).replace(',', '.')) * 1000
}