Skip to content

Commit 59d4351

Browse files
phabluloyyx990803
authored andcommittedOct 24, 2018
fix(transition): handle local-formatted floats in toMs function. (#8495)
fix #4894
1 parent 8c2674e commit 59d4351

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)
Please sign in to comment.