Skip to content

Commit

Permalink
fix(transition): handle local-formatted floats in toMs function. (#8495)
Browse files Browse the repository at this point in the history
fix #4894
  • Loading branch information
phablulo authored and yyx990803 committed Oct 24, 2018
1 parent 8c2674e commit 59d4351
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platforms/web/runtime/transition-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ function getTimeout (delays: Array<string>, durations: Array<string>): number {
}))
}

// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
// in a locale-dependent way, using a comma instead of a dot.
// 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 {
return Number(s.slice(0, -1)) * 1000
return Number(s.slice(0, -1).replace(',', '.')) * 1000
}

0 comments on commit 59d4351

Please sign in to comment.