mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
fix(space): fix ant-space-item selector (#40554)
This commit is contained in:
parent
cffd1e63d4
commit
8a5cbf330c
@ -197,4 +197,17 @@ describe('Space', () => {
|
||||
);
|
||||
spy.mockRestore();
|
||||
});
|
||||
|
||||
it('should render the hidden empty item wrapper', () => {
|
||||
const Null = () => null;
|
||||
const { container } = render(
|
||||
<Space>
|
||||
<Null />
|
||||
</Space>,
|
||||
);
|
||||
const item = container.querySelector('div.ant-space-item') as HTMLElement;
|
||||
|
||||
expect(item).toBeEmptyDOMElement();
|
||||
expect(getComputedStyle(item).display).toBe('none');
|
||||
});
|
||||
});
|
||||
|
@ -38,7 +38,7 @@ const genSpaceStyle: GenerateStyle<SpaceToken> = (token) => {
|
||||
alignItems: 'baseline',
|
||||
},
|
||||
},
|
||||
[`${componentCls}-space-item`]: {
|
||||
[`${componentCls}-item`]: {
|
||||
'&:empty': {
|
||||
display: 'none',
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user