From: Evan You Date: Wed, 14 Jun 2023 04:12:22 +0000 (+0800) Subject: fix(transition): handle possible auto value for transition/animation durations X-Git-Tag: v3.3.5~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96c76facb7de37fc241ccd55e121fd60a49a1452;p=thirdparty%2Fvuejs%2Fcore.git fix(transition): handle possible auto value for transition/animation durations close #8409 --- diff --git a/packages/runtime-dom/src/components/Transition.ts b/packages/runtime-dom/src/components/Transition.ts index 0cbf924b00..eebfdccca3 100644 --- a/packages/runtime-dom/src/components/Transition.ts +++ b/packages/runtime-dom/src/components/Transition.ts @@ -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 }