From 0ba5ed85b7ff49f3a86f8898548f1b3556eb3c26 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 7 May 2024 14:24:18 -0700 Subject: [PATCH] Also dont allow setting value to null from number field which the browser seems to inexplicably do in certain locales when using a decimal instead of a comma --- .../common/input/monetary/monetary.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 4ed32e7a1..56f0dd28e 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 @@ -17,7 +17,15 @@ import { getLocaleCurrencyCode } from '@angular/common' }) export class MonetaryComponent extends AbstractInputComponent { public currency: string = '' - public monetaryValue: string = '' + + public _monetaryValue: string = '' + public get monetaryValue(): string { + return this._monetaryValue + } + public set monetaryValue(value: string) { + if (value) this._monetaryValue = value + } + defaultCurrencyCode: string constructor(@Inject(LOCALE_ID) currentLocale: string) {