fix(ui): 轉移 disabled 屬性至 SelectTrigger 修復數據丟失報錯,並關閉 Input 自動完成

This commit is contained in:
kennethcheng 2026-04-29 10:53:09 +08:00
parent 06e52d58d6
commit 955b01fd79

View File

@ -100,8 +100,8 @@ export function UpdateTransactionDialog({
useEffect(() => {
if (transaction && open) {
form.reset({
assetId: transaction.assetId,
txType: transaction.txType,
assetId: String(transaction.assetId),
txType: String(transaction.txType),
quantity: parseFloat(transaction.quantity).toString(),
price: parseFloat(transaction.price).toString(),
fee: parseFloat(transaction.fee || 0).toString(),
@ -150,9 +150,9 @@ export function UpdateTransactionDialog({
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<Select disabled={true} onValueChange={field.onChange} value={field.value} defaultValue={field.value}>
<Select onValueChange={field.onChange} value={field.value} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectTrigger disabled={true}>
<SelectValue placeholder="选择资产" />
</SelectTrigger>
</FormControl>
@ -174,9 +174,9 @@ export function UpdateTransactionDialog({
render={({ field }) => (
<FormItem>
<FormLabel></FormLabel>
<Select disabled={true} onValueChange={field.onChange} value={field.value} defaultValue={field.value}>
<Select onValueChange={field.onChange} value={field.value} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectTrigger disabled={true}>
<SelectValue placeholder="选择交易类型" />
</SelectTrigger>
</FormControl>
@ -201,7 +201,7 @@ export function UpdateTransactionDialog({
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input type="text" {...field} />
<Input type="text" autoComplete="off" {...field} />
</FormControl>
<FormMessage />
</FormItem>
@ -214,7 +214,7 @@ export function UpdateTransactionDialog({
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input type="text" {...field} />
<Input type="text" autoComplete="off" {...field} />
</FormControl>
<FormMessage />
</FormItem>
@ -229,7 +229,7 @@ export function UpdateTransactionDialog({
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input type="text" {...field} />
<Input type="text" autoComplete="off" {...field} />
</FormControl>
<FormMessage />
</FormItem>
@ -265,7 +265,7 @@ export function UpdateTransactionDialog({
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input type="datetime-local" {...field} />
<Input type="datetime-local" autoComplete="off" {...field} />
</FormControl>
<FormMessage />
</FormItem>