fix: validated should be reset when trigger reset event (#41976)

This commit is contained in:
kiner-tang(文辉) 2023-04-25 09:58:57 +08:00 committed by GitHub
parent 19a5f6ddd2
commit b31bec59af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 19 deletions

View File

@ -20625,14 +20625,35 @@ exports[`renders components/form/demo/validate-other.tsx extend context correctl
<div
class="ant-form-item-control-input-content"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
<div
class="ant-space ant-space-horizontal ant-space-align-center"
>
<span>
Submit
</span>
</button>
<div
class="ant-space-item"
style="margin-right: 8px;"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
>
<span>
Submit
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default"
type="reset"
>
<span>
reset
</span>
</button>
</div>
</div>
</div>
</div>
</div>

View File

@ -9505,14 +9505,35 @@ exports[`renders components/form/demo/validate-other.tsx correctly 1`] = `
<div
class="ant-form-item-control-input-content"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
<div
class="ant-space ant-space-horizontal ant-space-align-center"
>
<span>
Submit
</span>
</button>
<div
class="ant-space-item"
style="margin-right:8px"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
>
<span>
Submit
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default"
type="reset"
>
<span>
reset
</span>
</button>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,4 +1,3 @@
import React from 'react';
import { InboxOutlined, UploadOutlined } from '@ant-design/icons';
import {
Button,
@ -11,9 +10,11 @@ import {
Row,
Select,
Slider,
Space,
Switch,
Upload,
} from 'antd';
import React from 'react';
const { Option } = Select;
@ -181,9 +182,12 @@ const App: React.FC = () => (
</Form.Item>
<Form.Item wrapperCol={{ span: 12, offset: 6 }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
<Space>
<Button type="primary" htmlType="submit">
Submit
</Button>
<Button htmlType="reset">reset</Button>
</Space>
</Form.Item>
</Form>
);

View File

@ -126,7 +126,7 @@
"rc-dialog": "~9.1.0",
"rc-drawer": "~6.1.1",
"rc-dropdown": "~4.0.0",
"rc-field-form": "~1.29.0",
"rc-field-form": "~1.30.0",
"rc-image": "~5.16.0",
"rc-input": "~1.0.4",
"rc-input-number": "~7.4.0",