From 3c301a134657c6a3f9d70889120087553749fe6d Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 10 Apr 2024 07:35:36 -0700 Subject: [PATCH] Actually do it like this --- .../components/common/input/monetary/monetary.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src-ui/src/app/components/common/input/monetary/monetary.component.ts b/src-ui/src/app/components/common/input/monetary/monetary.component.ts index bc63bc8ca..db190c59d 100644 --- a/src-ui/src/app/components/common/input/monetary/monetary.component.ts +++ b/src-ui/src/app/components/common/input/monetary/monetary.component.ts @@ -35,17 +35,18 @@ export class MonetaryComponent extends AbstractInputComponent { get currencyCode(): string { const focused = document.activeElement === this.currencyField?.nativeElement - if (focused && this.value) return this.value.match(/^([a-zA-Z]{0,3})/)?.[0] + if (focused && this.value) + return this.value.toUpperCase().match(/^([A-Z]{0,3})/)?.[0] return ( this.value ?.toString() .toUpperCase() - .match(/^([a-zA-Z]{1,3})/)?.[0] ?? this.defaultCurrencyCode + .match(/^([A-Z]{1,3})/)?.[0] ?? this.defaultCurrencyCode ) } set currencyCode(value: string) { - this.value = value + this.monetaryValue?.toString() + this.value = value.toUpperCase() + this.monetaryValue?.toString() } get monetaryValue(): string {