Fix text overflow issues in list item component (#38954)

This commit is contained in:
diondiondion 2026-05-08 10:34:55 +02:00 committed by GitHub
parent 9ff094b62e
commit b71333921b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 2 deletions

View File

@ -90,7 +90,7 @@ export const AccountListItem: React.FC<Props> = ({
<ListItemLink <ListItemLink
to={`/@${account.acct}`} to={`/@${account.acct}`}
data-hover-card-account={accountId} data-hover-card-account={accountId}
subtitle={handle} subtitle={<span className={classes.handle}>{handle}</span>}
> >
<DisplayNameSimple <DisplayNameSimple
account={account} account={account}

View File

@ -24,6 +24,13 @@
vertical-align: -4px; vertical-align: -4px;
} }
.handle {
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.button { .button {
align-self: start; align-self: start;
} }

View File

@ -30,7 +30,7 @@ export const ListItemWrapper: React.FC<WrapperProps> = ({
return ( return (
<div {...otherProps} className={classNames(classes.wrapper, className)}> <div {...otherProps} className={classNames(classes.wrapper, className)}>
{icon} {icon}
<div>{children}</div> <div className={classes.main}>{children}</div>
{sideContent && ( {sideContent && (
<span className={classes.sideContent}>{sideContent}</span> <span className={classes.sideContent}>{sideContent}</span>
)} )}

View File

@ -14,6 +14,11 @@
color: var(--color-text-primary); color: var(--color-text-primary);
} }
.main {
min-width: 0;
overflow-wrap: break-word;
}
.title { .title {
font-weight: 500; font-weight: 500;