Skip to content

Commit

Permalink
fix(transition): handle local-formatted floats in toMs function. (vue…
Browse files Browse the repository at this point in the history
  • Loading branch information
phablulo authored and hefeng committed Jan 25, 2019
1 parent 2ebd88d commit e5b7db2
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 e5b7db2

Please sign in to comment.