fix(ui): 轉移 disabled 屬性至 SelectTrigger 修復數據丟失報錯,並關閉 Input 自動完成
This commit is contained in:
parent
06e52d58d6
commit
955b01fd79
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user