Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sibling Tags should have margin #47736

Merged
merged 9 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ Array [
exports[`renders components/tag/demo/animation.tsx extend context correctly 2`] = `[]`;

exports[`renders components/tag/demo/basic.tsx extend context correctly 1`] = `
<div
class="ant-flex ant-flex-wrap-wrap ant-flex-gap-small"
>
Array [
<span
class="ant-tag"
>
Tag 1
</span>
</span>,
<span
class="ant-tag"
>
Expand All @@ -152,7 +150,7 @@ exports[`renders components/tag/demo/basic.tsx extend context correctly 1`] = `
>
Link
</a>
</span>
</span>,
<span
class="ant-tag"
>
Expand All @@ -178,7 +176,7 @@ exports[`renders components/tag/demo/basic.tsx extend context correctly 1`] = `
/>
</svg>
</span>
</span>
</span>,
<span
class="ant-tag"
>
Expand Down Expand Up @@ -207,8 +205,8 @@ exports[`renders components/tag/demo/basic.tsx extend context correctly 1`] = `
</svg>
</span>
</span>
</span>
</div>
</span>,
]
`;

exports[`renders components/tag/demo/basic.tsx extend context correctly 2`] = `[]`;
Expand Down
14 changes: 6 additions & 8 deletions components/tag/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,12 @@ Array [
`;

exports[`renders components/tag/demo/basic.tsx correctly 1`] = `
<div
class="ant-flex ant-flex-wrap-wrap ant-flex-gap-small"
>
Array [
<span
class="ant-tag"
>
Tag 1
</span>
</span>,
<span
class="ant-tag"
>
Expand All @@ -150,7 +148,7 @@ exports[`renders components/tag/demo/basic.tsx correctly 1`] = `
>
Link
</a>
</span>
</span>,
<span
class="ant-tag"
>
Expand All @@ -176,7 +174,7 @@ exports[`renders components/tag/demo/basic.tsx correctly 1`] = `
/>
</svg>
</span>
</span>
</span>,
<span
class="ant-tag"
>
Expand Down Expand Up @@ -205,8 +203,8 @@ exports[`renders components/tag/demo/basic.tsx correctly 1`] = `
</svg>
</span>
</span>
</span>
</div>
</span>,
]
`;

exports[`renders components/tag/demo/borderless.tsx correctly 1`] = `
Expand Down
6 changes: 3 additions & 3 deletions components/tag/demo/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import { CloseCircleOutlined } from '@ant-design/icons';
import { Flex, Tag } from 'antd';
import { Tag } from 'antd';

const preventDefault = (e: React.MouseEvent<HTMLElement>) => {
e.preventDefault();
console.log('Clicked! But prevent default.');
};

const App: React.FC = () => (
<Flex gap="small" wrap="wrap">
<>
<Tag>Tag 1</Tag>
<Tag>
<a href="https://github.com/ant-design/ant-design/issues/1862">Link</a>
Expand All @@ -19,7 +19,7 @@ const App: React.FC = () => (
<Tag closeIcon={<CloseCircleOutlined />} onClose={console.log}>
Tag 2
</Tag>
</Flex>
</>
);

export default App;
1 change: 1 addition & 0 deletions components/tag/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const genBaseStyle = (token: TagToken): CSSInterpolation => {
...resetComponent(token),
display: 'inline-block',
height: 'auto',
marginInlineEnd: token.marginXS,
MadCcc marked this conversation as resolved.
Show resolved Hide resolved
paddingInline,
fontSize: token.tagFontSize,
lineHeight: token.tagLineHeight,
Expand Down