ant-design / ant-design/pro-components

Form 组件 onFinish 的 values 参数 和 form.getFieldsValue() 结果不一致

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

### Reproduction link

[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/mwfinsim?file=App.tsx)

https://codesandbox.io/p/sandbox/proform-date-bug-m6jjyp

### Steps to reproduce

1. fill in the form fields
2. submit
3. check the data log inside the console: the `contractTime` is not available in the Form.onFinish.values

### What is expected?

`values.contractTime` supposed to be Date[], same as the `form.getFieldsValue().contractTime` result.

### What is actually happening?

`values.contractTime` is empty object array.
`form.getFieldsValue().contractTime` is Date array.

Image

| Environment | Info |
| --- | --- |
| antd | 5.24.3 |
| React | 19.0.0 |
| System | macos |
| Browser | chrome |

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz or CodeSandbox reproduction and inspect the Form.onFinish values alongside form.getFieldsValue() for contractTime. Confirm the behavior with the listed Ant Design, React, and Chrome versions; done means values.contractTime is a Date[] matching the form.getFieldsValue().contractTime result.

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.