Skip to content

Commit

Permalink
fix(card): The extra element and title ellipsis in the checkcard are …
Browse files Browse the repository at this point in the history
…not functioning correctly when the title is too long
  • Loading branch information
justnewneo committed Apr 23, 2024
1 parent ab422b6 commit 8d5a850
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/card/src/components/CheckCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ const CheckCard: React.FC<CheckCardProps> & {
const headerDom = (title ?? extra) != null && (
<div className={classNames(`${prefixCls}-header`, hashId)}>
<div className={classNames(`${prefixCls}-header-left`, hashId)}>
<div className={classNames(`${prefixCls}-title`, hashId)}>
<div
className={classNames(`${prefixCls}-title`, hashId, {
[`${prefixCls}-title-with-ellipsis`]: typeof title === 'string',
})}
>
{title}
</div>
{props.subTitle ? (
Expand Down
6 changes: 5 additions & 1 deletion packages/card/src/components/CheckCard/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const genProStyle: GenerateStyle<ProListToken> = (token) => {
height: 0,
border: `${token.borderRadius + 4}px solid ${
token.colorTextDisabled
}`,
}`,
borderBlockEnd: `${token.borderRadius + 4}px solid transparent`,
borderInlineStart: `${token.borderRadius + 4}px solid transparent`,
borderStartEndRadius: `${token.borderRadius}px`,
Expand Down Expand Up @@ -173,6 +173,7 @@ const genProStyle: GenerateStyle<ProListToken> = (token) => {
display: 'flex',
alignItems: 'center',
gap: token.sizeSM,
minWidth: 0,
},
},
'&-title': {
Expand All @@ -185,6 +186,9 @@ const genProStyle: GenerateStyle<ProListToken> = (token) => {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
'&-with-ellipsis': {
display: 'inline-block'
},
},
'&-description': {
color: token.colorTextSecondary,
Expand Down

0 comments on commit 8d5a850

Please sign in to comment.