ant-design / ant-design/pro-components

多层list嵌套中的日期组件,getFieldsFormatValue未对其生效🐛[BUG]

Open
#5,873 7 comments 1 reaction 0 assignees View on GitHub
⭕️ bug AI Reply form
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🐛 bug 描述

多层list嵌套,在深层嵌套的list中使用日期组件设置了format,但使用getFieldsFormatValue返回的数据并未格式化

### 💻 复现代码
```tsx
import { ProFormInstance, ProFormItem, ProFormTimePicker } from '@ant-design/pro-components';
import { ProForm, ProFormList } from '@ant-design/pro-components';
import { useRef } from 'react';

export default () => {
const formRef = useRef<
ProFormInstance<{
name: string;
company?: string;
useMode?: string;
}>
>();
return (

formRef={formRef}
formKey="base-form-use-demo"
autoFocusFirstInput
>

{() => {
return (



);
}}


{() => {
return (


getFieldsFormatValue格式化:
{JSON.stringify(formRef.current?.getFieldsFormatValue?.())}

);
}}


{() => {
return (
getFieldsValue未格式化:{JSON.stringify(formRef.current?.getFieldsValue?.())}

);
}}


);
};
```

### 🏞 期望结果

![image](https://user-images.githubusercontent.com/34681836/188558625-9c7fb5cc-0eb0-4490-8e1c-9781d6dafb22.png)

### © 版本信息

- ProComponents 版本: 最新版本

Contributor guide

Open the contributing guide

Research direction

Start by running the nested ProFormList reproduction and inspect the getFieldsFormatValue entry point used by ProFormInstance. Trace how the nested ProFormTimePicker format is handled, then verify that the returned value is formatted at the deepest list level without changing getFieldsValue behavior.

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.