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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user