fix(ui): 轉移 disabled 屬性至 SelectTrigger 修復數據丟失報錯,並關閉 Input 自動完成
This commit is contained in:
parent
06e52d58d6
commit
955b01fd79
@ -100,8 +100,8 @@ export function UpdateTransactionDialog({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (transaction && open) {
|
if (transaction && open) {
|
||||||
form.reset({
|
form.reset({
|
||||||
assetId: transaction.assetId,
|
assetId: String(transaction.assetId),
|
||||||
txType: transaction.txType,
|
txType: String(transaction.txType),
|
||||||
quantity: parseFloat(transaction.quantity).toString(),
|
quantity: parseFloat(transaction.quantity).toString(),
|
||||||
price: parseFloat(transaction.price).toString(),
|
price: parseFloat(transaction.price).toString(),
|
||||||
fee: parseFloat(transaction.fee || 0).toString(),
|
fee: parseFloat(transaction.fee || 0).toString(),
|
||||||
@ -150,9 +150,9 @@ export function UpdateTransactionDialog({
|
|||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>标的资产</FormLabel>
|
<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>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger disabled={true}>
|
||||||
<SelectValue placeholder="选择资产" />
|
<SelectValue placeholder="选择资产" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@ -174,9 +174,9 @@ export function UpdateTransactionDialog({
|
|||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>交易类型</FormLabel>
|
<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>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger disabled={true}>
|
||||||
<SelectValue placeholder="选择交易类型" />
|
<SelectValue placeholder="选择交易类型" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@ -201,7 +201,7 @@ export function UpdateTransactionDialog({
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>數量</FormLabel>
|
<FormLabel>數量</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input type="text" {...field} />
|
<Input type="text" autoComplete="off" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -214,7 +214,7 @@ export function UpdateTransactionDialog({
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>價格</FormLabel>
|
<FormLabel>價格</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input type="text" {...field} />
|
<Input type="text" autoComplete="off" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -229,7 +229,7 @@ export function UpdateTransactionDialog({
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>手續費</FormLabel>
|
<FormLabel>手續費</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input type="text" {...field} />
|
<Input type="text" autoComplete="off" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@ -265,7 +265,7 @@ export function UpdateTransactionDialog({
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>執行時間</FormLabel>
|
<FormLabel>執行時間</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input type="datetime-local" {...field} />
|
<Input type="datetime-local" autoComplete="off" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user