Skip to content

Commit a362e9c

Browse files
phabluloaJean
authored andcommitted
fix(transition): handle local-formatted floats in toMs function. (vuejs#8495)
fix vuejs#4894
1 parent 6d4feab commit a362e9c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/platforms/web/runtime/transition-util.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ function getTimeout (delays: Array<string>, durations: Array<string>): number {
181181
}))
182182
}
183183

184+
// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
185+
// in a locale-dependent way, using a comma instead of a dot.
186+
// If comma is not replaced with a dot, the input will be rounded down (i.e. acting
187+
// as a floor function) causing unexpected behaviors
184188
function toMs (s: string): number {
185-
return Number(s.slice(0, -1)) * 1000
189+
return Number(s.slice(0, -1).replace(',', '.')) * 1000
186190
}

0 commit comments

Comments
 (0)