]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(transition): handle possible auto value for transition/animation durations
authorEvan You <yyx990803@gmail.com>
Wed, 14 Jun 2023 04:12:22 +0000 (12:12 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 14 Jun 2023 04:12:22 +0000 (12:12 +0800)
close #8409

packages/runtime-dom/src/components/Transition.ts

index 0cbf924b00d4d9b92e64eac3de82c2a235918b34..eebfdccca352621bd993692f589c10d393b5f5b6 100644 (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
 }