web/composer: don't allow typing notifications to overflow

This commit is contained in:
Tulir Asokan 2024-12-12 00:42:54 +02:00
parent ddd97655b0
commit f80df9a8f5
2 changed files with 10 additions and 2 deletions

View file

@ -6,6 +6,7 @@ div.typing-notifications {
gap: 0.5rem;
align-items: center;
font-size: 0.9rem;
overflow: hidden;
> div.avatars {
display: flex;
@ -16,4 +17,11 @@ div.typing-notifications {
margin-left: -0.35rem;
}
}
> div.description {
text-wrap: nowrap;
/* TODO detect overflow and show "x users are typing" instead? */
overflow: hidden;
text-overflow: ellipsis;
}
}

View file

@ -52,9 +52,9 @@ const TypingNotifications = () => {
let description: JSX.Element | null = null
if (typing.length > 4) {
description = <div>{typing.length} users are typing</div>
description = <div className="description">{typing.length} users are typing</div>
} else if (typing.length > 0) {
description = <div>
description = <div className="description">
{humanJoinReact(memberNames)}
{typing.length === 1 ? " is " : " are "}
typing