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
This commit is contained in:
shamoon 2024-05-07 14:24:18 -07:00
parent e929d5cd84
commit 0ba5ed85b7

View File

@ -17,7 +17,15 @@ import { getLocaleCurrencyCode } from '@angular/common'
})
export class MonetaryComponent extends AbstractInputComponent<string> {
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) {