Skip to content

Commit

Permalink
fix(TagSelect): fix wrong bottom-bottom of last-child
Browse files Browse the repository at this point in the history
  • Loading branch information
HytonightYX committed Aug 9, 2022
1 parent 776285e commit e0c74cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/components/layout/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ const attachedStyle = css`
`;

const normalStyle = css<any>`
> *:not(:last-child) {
margin-right: ${(props) => props.$spacingX};
> * {
margin-bottom: ${(props) => props.$spacingY};
&:not(:last-child) {
margin-right: ${(props) => props.$spacingX};
}
}
`;

Expand Down
14 changes: 14 additions & 0 deletions packages/story/src/tag-select.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { TagSelect, Group } from '@rexd/core';
import { range, random } from 'lodash';

export default { title: 'TagSelect' };

Expand All @@ -17,6 +18,19 @@ export const Multiple = () => {
return <TagSelect dataSource={list} selectMode="multiple" defaultValue={['front-end']} onChange={console.log} />;
};

export const Warp = () => {
return (
<div style={{ width: 360, border: '2px dashed #F4F4F4' }}>
<TagSelect
dataSource={range(20).map((x) => ({
value: String(x),
label: (Math.random() + 1).toString(36).substring(random(2, 8)),
}))}
/>
</div>
);
};

export const Size = () => (
<Group>
<TagSelect
Expand Down

0 comments on commit e0c74cf

Please sign in to comment.