fix(transaction): initialize CurrencyInput with a real currency code

vue-currency-input required a currency code for Intl.NumberFormat;
passing undefined threw inside the mount watcher, leaving the input
without listeners so amount stayed null on submit.

Use CurrencyDisplay.hidden to keep the symbol out of the field since
the currency selector is rendered separately.
This commit is contained in:
Julien Calixte
2026-06-02 21:24:39 +02:00
parent 901f7f4c02
commit 0099e51f94

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { watch } from 'vue'
import { useCurrencyInput } from 'vue-currency-input'
import { useCurrencyInput, CurrencyDisplay } from 'vue-currency-input'
const props = withDefaults(
defineProps<{
@@ -23,7 +23,8 @@ const props = withDefaults(
defineEmits<{ 'update:modelValue': [value: number | null] }>()
const { inputRef, setValue } = useCurrencyInput({
currency: undefined as unknown as string,
currency: 'USD',
currencyDisplay: CurrencyDisplay.hidden,
locale: props.locale,
precision: props.precision,
hideCurrencySymbolOnFocus: false,