From 009d6136f0139377ab3cf6cda8983b18d1c29f36 Mon Sep 17 00:00:00 2001
From: Tanmay Vardhaman Thole <72058456+tanmaythole@users.noreply.github.com>
Date: Thu, 26 Oct 2023 12:24:06 +0530
Subject: [PATCH] [MM-54118] Special mentions (`@here`, `@channel`) are not
formatted correctly in the RHS (#24800)
---
.../__snapshots__/at_mention_suggestion.test.tsx.snap | 8 ++++++--
.../at_mention_provider/at_mention_suggestion.tsx | 4 ++--
.../src/components/suggestion/rhs_suggestion_list.tsx | 2 +-
.../channels/src/sass/components/_suggestion-list.scss | 9 ++++++---
4 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/webapp/channels/src/components/suggestion/at_mention_provider/__snapshots__/at_mention_suggestion.test.tsx.snap b/webapp/channels/src/components/suggestion/at_mention_provider/__snapshots__/at_mention_suggestion.test.tsx.snap
index 8b794b1fdb..574a3bee61 100644
--- a/webapp/channels/src/components/suggestion/at_mention_provider/__snapshots__/at_mention_suggestion.test.tsx.snap
+++ b/webapp/channels/src/components/suggestion/at_mention_provider/__snapshots__/at_mention_suggestion.test.tsx.snap
@@ -76,7 +76,9 @@ exports[`at mention suggestion Should display nick name of non signed in user 1`
>
@user2
- a b (c)
+
+ a b (c)
+
@user
- a b
+
+ a b
+
{Utils.getFullName(item)};
}
} else if (item.first_name || item.last_name || item.nickname) {
- description = `${Utils.getFullName(item)} ${item.nickname ? `(${item.nickname})` : ''}`.trim();
+ description = {`${Utils.getFullName(item)} ${item.nickname ? `(${item.nickname})` : ''}`.trim()};
}
icon = (
diff --git a/webapp/channels/src/components/suggestion/rhs_suggestion_list.tsx b/webapp/channels/src/components/suggestion/rhs_suggestion_list.tsx
index 6e8669f200..d064095aaf 100644
--- a/webapp/channels/src/components/suggestion/rhs_suggestion_list.tsx
+++ b/webapp/channels/src/components/suggestion/rhs_suggestion_list.tsx
@@ -28,7 +28,7 @@ export default function RhsSuggestionList(props: Props): JSX.Element {
setPosition(newPosition);
}
}
- }, [props.inputRef, props.open]);
+ }, [position, props.inputRef, props.open]);
return (
span:nth-child(2) {
+ overflow: hidden;
+ width: 100%;
+ text-overflow: ellipsis;
+ }
}
.suggestion-list__flex {