ant-design / ant-design/pro-components
🐛[BUG] ProFormList在单个新record时,ProFormSelect 的 transform不会触发
- 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",
### 🚑 其他信息

Contributor 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