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 aJean committed Aug 19, 2020
1 parent 6d4feab commit a362e9c
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 a362e9c

Please sign in to comment.