소스 검색

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

close #8409
Evan You 3 년 전
부모
커밋
96c76facb7
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      packages/runtime-dom/src/components/Transition.ts

+ 2 - 0
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
 }