Skip to content

Commit 96c76fa

Browse files
committed
fix(transition): handle possible auto value for transition/animation durations
close #8409
1 parent 1f83020 commit 96c76fa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ function getTimeout(delays: string[], durations: string[]): number {
445445
// If comma is not replaced with a dot, the input will be rounded down
446446
// (i.e. acting as a floor function) causing unexpected behaviors
447447
function toMs(s: string): number {
448+
// #8409 default value for CSS durations can be 'auto'
449+
if (s === 'auto') return 0
448450
return Number(s.slice(0, -1).replace(',', '.')) * 1000
449451
}
450452

0 commit comments

Comments
 (0)