style(List.Item.Meta): Avatar and title are not aligned (#41688)

* fix(List.Item.Meta):Avatar and title are not aligned

* chore: add test case
This commit is contained in:
JiaQi 2023-04-07 23:39:23 +08:00 committed by GitHub
parent 4dc86da9e5
commit b483ef8c3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -230,4 +230,20 @@ describe('List Item Layout', () => {
rerender(getDom(5));
expect(loadId).toEqual([1, 3, 5]);
});
it('List.Item.Meta title should have no default margin', () => {
const { container } = render(
<List
dataSource={[{ id: 1, title: `ant design` }]}
renderItem={(item) => (
<List.Item>
<List.Item.Meta title={item.title} />
</List.Item>
)}
/>,
);
const title = container.querySelector('.ant-list-item-meta-title');
expect(title && getComputedStyle(title).margin).toEqual('0px 0px 4px 0px');
});
});

View File

@ -187,7 +187,7 @@ const genBaseStyle: GenerateStyle<ListToken> = (token) => {
},
[`${componentCls}-item-meta-title`]: {
marginBottom: token.marginXXS,
margin: `0 0 ${token.marginXXS}px 0`,
color: colorText,
fontSize: token.fontSize,
lineHeight: token.lineHeight,