Skip to content

Commit

Permalink
chore: fix form demo style (ant-design#46156)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Nov 29, 2023
1 parent 7355535 commit 005fc97
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 56 deletions.
62 changes: 39 additions & 23 deletions components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1891,30 +1891,46 @@ exports[`renders components/form/demo/control-hooks.tsx extend context correctly
<div
class="ant-form-item-control-input-content"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
>
<span>
Submit
</span>
</button>
<button
class="ant-btn ant-btn-default"
type="button"
>
<span>
Reset
</span>
</button>
<button
class="ant-btn ant-btn-link"
type="button"
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
>
<span>
Fill form
</span>
</button>
<div
class="ant-space-item"
>
<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="button"
>
<span>
Reset
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-link"
type="button"
>
<span>
Fill form
</span>
</button>
</div>
</div>
</div>
</div>
</div>
Expand Down
62 changes: 39 additions & 23 deletions components/form/__tests__/__snapshots__/demo.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1418,30 +1418,46 @@ exports[`renders components/form/demo/control-hooks.tsx correctly 1`] = `
<div
class="ant-form-item-control-input-content"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
>
<span>
Submit
</span>
</button>
<button
class="ant-btn ant-btn-default"
type="button"
>
<span>
Reset
</span>
</button>
<button
class="ant-btn ant-btn-link"
type="button"
<div
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
>
<span>
Fill form
</span>
</button>
<div
class="ant-space-item"
>
<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="button"
>
<span>
Reset
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-link"
type="button"
>
<span>
Fill form
</span>
</button>
</div>
</div>
</div>
</div>
</div>
Expand Down
22 changes: 12 additions & 10 deletions components/form/demo/control-hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Button, Form, Input, Select } from 'antd';
import { Button, Form, Input, Select, Space } from 'antd';

const { Option } = Select;

Expand Down Expand Up @@ -77,15 +77,17 @@ const App: React.FC = () => {
}
</Form.Item>
<Form.Item {...tailLayout}>
<Button type="primary" htmlType="submit">
Submit
</Button>
<Button htmlType="button" onClick={onReset}>
Reset
</Button>
<Button type="link" htmlType="button" onClick={onFill}>
Fill form
</Button>
<Space>
<Button type="primary" htmlType="submit">
Submit
</Button>
<Button htmlType="button" onClick={onReset}>
Reset
</Button>
<Button type="link" htmlType="button" onClick={onFill}>
Fill form
</Button>
</Space>
</Form.Item>
</Form>
);
Expand Down

0 comments on commit 005fc97

Please sign in to comment.