ant-design / ant-design/pro-components

🐛[BUG] ProformList下的子表单项的transform方法在提交表单的时候不会执行。

Open
#8,705 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🐛 bug 描述

ProformList下的子表单项的transform方法在提交表单的时候不会执行。当ProFormList使用initialValue赋初始值的时候,点击提交按钮,并不会执行transform方法,需要点击 (+添加一行数据) 按钮,这个时候提交才会执行transform方法,并且再次点击提交按钮,依然不会执行transform方法; 这个问题在之前的使用中是不存在,今天重新执行 npm install 之后,发现了这个问题。

### 📷 复现步骤

import {PageContainer, ProForm, ProFormDatePicker, ProFormList, ProFormText,} from '@ant-design/pro-components';
import React from 'react';

const Welcome: React.FC = () => {
return (

{
console.log("values:", values)
}}
>

{
console.log("执行nameTransform");
return value + 1;
}}
/>
{
console.log("执行birthTransform");
return value;
}}
/>



);
};

export default Welcome;

### 🏞 期望结果

### 💻 复现代码

### © 版本信息

- ProComponents "antd": "^5.13.2",

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported behavior with ProForm, ProFormList, ProFormText, and ProFormDatePicker using the supplied initialValue and transform callbacks. Trace how ProFormList submits its initial rows and invokes child transforms. Done means submitting without adding a row invokes both transforms and produces transformed values.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.