From 21fb77e3c634f1b4f892355e34e0c418401f3ee5 Mon Sep 17 00:00:00 2001 From: anveshmekala Date: Tue, 13 Jun 2023 17:37:49 -0500 Subject: [PATCH 1/2] fix(input,input-number): allow typing decimal separator in firefox for arabic locale --- packages/calcite-components/src/utils/locale.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/calcite-components/src/utils/locale.ts b/packages/calcite-components/src/utils/locale.ts index 42fb4d9ef39..7c96737aa4b 100644 --- a/packages/calcite-components/src/utils/locale.ts +++ b/packages/calcite-components/src/utils/locale.ts @@ -402,7 +402,11 @@ export class NumberStringFormat { ].reverse(); const index = new Map(this._digits.map((d, i) => [d, i])); - const parts = new Intl.NumberFormat(this._numberFormatOptions.locale).formatToParts(-12345678.9); + + // numberingSystem is required to return consistent decimal separator across browsers + const parts = new Intl.NumberFormat(this._numberFormatOptions.locale, { + numberingSystem: this._numberFormatOptions.numberingSystem + } as Intl.NumberFormatOptions).formatToParts(-12345678.9); this._actualGroup = parts.find((d) => d.type === "group").value; // change whitespace group characters that don't render correctly From 56a7ab39403c6d5b8b14a83148851283be090e2a Mon Sep 17 00:00:00 2001 From: anveshmekala Date: Wed, 14 Jun 2023 11:14:58 -0500 Subject: [PATCH 2/2] update comments --- packages/calcite-components/src/utils/locale.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/calcite-components/src/utils/locale.ts b/packages/calcite-components/src/utils/locale.ts index 7c96737aa4b..448d2bd90dd 100644 --- a/packages/calcite-components/src/utils/locale.ts +++ b/packages/calcite-components/src/utils/locale.ts @@ -403,7 +403,7 @@ export class NumberStringFormat { const index = new Map(this._digits.map((d, i) => [d, i])); - // numberingSystem is required to return consistent decimal separator across browsers + // numberingSystem is parsed to return consistent decimal separator across browsers. const parts = new Intl.NumberFormat(this._numberFormatOptions.locale, { numberingSystem: this._numberFormatOptions.numberingSystem } as Intl.NumberFormatOptions).formatToParts(-12345678.9);