From ba0d276ae309b5c9be9d0836c9e39d279de5cf3b Mon Sep 17 00:00:00 2001 From: kwingram25 Date: Mon, 8 Apr 2019 03:45:41 -0700 Subject: [PATCH] Fix Safari Intl issue (#924) --- packages/ui-app/src/Input.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/ui-app/src/Input.tsx b/packages/ui-app/src/Input.tsx index f1edb3a541..f59e89883c 100644 --- a/packages/ui-app/src/Input.tsx +++ b/packages/ui-app/src/Input.tsx @@ -46,10 +46,9 @@ type State = { }; // Find decimal separator used in current locale -const getDecimalSeparator = (): string => Intl.NumberFormat() - .formatToParts(1.1) - .find(part => part.type === 'decimal')! - .value; +const getDecimalSeparator = (): string => 1.1 + .toLocaleString() + .replace(/\d/g, ''); // note: KeyboardEvent.keyCode and KeyboardEvent.which are deprecated const KEYS = {