mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
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:
parent
4dc86da9e5
commit
b483ef8c3f
@ -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');
|
||||
});
|
||||
});
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user