Allow lowercase letters in monetary currency field

This commit is contained in:
shamoon 2024-04-10 07:26:32 -07:00
parent 95c24a50f7
commit c690dad174

View File

@ -35,12 +35,12 @@ export class MonetaryComponent extends AbstractInputComponent<string> {
get currencyCode(): string { get currencyCode(): string {
const focused = document.activeElement === this.currencyField?.nativeElement const focused = document.activeElement === this.currencyField?.nativeElement
if (focused && this.value) return this.value.match(/^([A-Z]{0,3})/)?.[0] if (focused && this.value) return this.value.match(/^([a-zA-Z]{0,3})/)?.[0]
return ( return (
this.value this.value
?.toString() ?.toString()
.toUpperCase() .toUpperCase()
.match(/^([A-Z]{1,3})/)?.[0] ?? this.defaultCurrencyCode .match(/^([a-zA-Z]{1,3})/)?.[0] ?? this.defaultCurrencyCode
) )
} }