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 24, 2024
1 parent ab422b6 commit bf21788
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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
4 changes: 4 additions & 0 deletions packages/card/src/components/CheckCard/style.ts
Original file line number Diff line number Diff line change
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 bf21788

Please sign in to comment.