Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue adding zero running on iOS 9 with Safari #88

Open
gustavopch opened this issue Feb 8, 2019 · 0 comments
Open

Issue adding zero running on iOS 9 with Safari #88

gustavopch opened this issue Feb 8, 2019 · 0 comments

Comments

@gustavopch
Copy link

gustavopch commented Feb 8, 2019

There's a bug in this lib when running on iOS 9 with Safari where if you have 0.03 in the input, pressing 0 with the cursor at the end doesn't get you 0.30.

After hours looking into the source code, I've found the cause: toLocaleString is not supported by iOS 9. I had to patch-package the node module like this to make it work:

-            initialValue = Number(initialValue).toLocaleString(undefined, {
-                style                : 'decimal',
-                minimumFractionDigits: props.precision,
-                maximumFractionDigits: props.precision
-            });
+            initialValue = Number(initialValue).toFixed(props.precision);

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant