diff options
Diffstat (limited to 'packages/web-util/src/forms/InputAmount.tsx')
-rw-r--r-- | packages/web-util/src/forms/InputAmount.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/web-util/src/forms/InputAmount.tsx b/packages/web-util/src/forms/InputAmount.tsx index 9be9dd4d0..29ec43525 100644 --- a/packages/web-util/src/forms/InputAmount.tsx +++ b/packages/web-util/src/forms/InputAmount.tsx @@ -1,7 +1,8 @@ import { AmountJson, Amounts, TranslatedString } from "@gnu-taler/taler-util"; import { VNode, h } from "preact"; -import { InputLine, UIFormProps } from "./InputLine.js"; +import { InputLine } from "./InputLine.js"; import { useField } from "./useField.js"; +import { UIFormProps } from "./FormProvider.js"; export function InputAmount<T extends object, K extends keyof T>( props: { currency?: string } & UIFormProps<T, K>, @@ -21,7 +22,8 @@ export function InputAmount<T extends object, K extends keyof T>( converter={{ //@ts-ignore fromStringUI: (v): AmountJson => { - return Amounts.parseOrThrow(`${currency}:${v}`); + + return Amounts.parse(`${currency}:${v}`) ?? Amounts.zeroOfCurrency(currency); }, //@ts-ignore toStringUI: (v: AmountJson) => { |