ant-design / ant-design/pro-components

🐛[BUG] ProFormList在单个新record时,ProFormSelect 的 transform不会触发

Open
#9,109 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

### 🐛 bug 描述
ProFormList在单个新record时,ProFormSelect 的 transform不会触发
反之,多个新record时,transform正常触发

### 📷 复现步骤
```
transform={(value: string[]) => {
console.log('transform')
console.log(value)
return {prodLine: value[0]}
}}
```
在创建新时,尝试只新增一个record,然后submit
然后尝试新增多个record,然后submit

### 🏞 期望结果
无论新增多少record都好,transform在submit时候都要正常触发

### 💻 复现代码

```

{(_meta, currIndex, _action, _count) => {
return (

tags.map(str => str.toUpperCase())}
fieldProps={{
fetchDataOnSearch: false,
showSearch: true,
maxCount: 1,
tagRender: (props) => {props.label}
}}
transform={(value: string[]) => {
console.log('transform')
console.log(value)
return {prodLine: value[0]}
}}
rules={[
{required: true, message: ''}
]}
/>

)
}}

```

### © 版本信息

"antd": "^5.25.0",
"@ant-design/pro-components": "^2.8.2",

### 🚑 其他信息

![Image](https://github.com/user-attachments/assets/c2101c2d-d5ff-44ab-94f1-5712ac58ab64)

Contributor guide

Open the contributing guide

Research direction

Start with the ProFormList and ProFormSelect implementation, then reproduce the submitted example using antd 5.25.0 and @ant-design/pro-components 2.8.2. Compare submission with one new record against multiple new records; done means the select transform runs consistently in both cases and returns the expected prodLine value.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.