Skip to content

Commit 111e3cf

Browse files
authored
Merge pull request #836 from GetStream/context-mentions-bug
Fix channel mentions hook bug
2 parents 105d9d2 + b38db25 commit 111e3cf

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/components/Channel/hooks/useMentionsHandlers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ export const useMentionsHandlers = <Us extends DefaultUserType<Us> = DefaultUser
2020
}
2121

2222
const target = event.target;
23-
const tagName = target.tagName.toLowerCase();
2423
const textContent = target.innerHTML.replace('*', '');
2524

26-
if (tagName === 'strong' && textContent[0] === '@') {
25+
if (textContent[0] === '@') {
2726
const userName = textContent.replace('@', '');
2827
const user = mentioned_users.find(({ id, name }) => name === userName || id === userName);
2928

src/components/MessageList/MessageList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ type PropsDrilledToMessage =
372372
| 'getPinMessageErrorNotification'
373373
| 'messageActions'
374374
| 'mutes'
375+
| 'onMentionsClick'
376+
| 'onMentionsHover'
375377
| 'onUserClick'
376378
| 'onUserHover'
377379
| 'pinPermissions'

src/components/MessageList/VirtualizedMessageList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const VirtualizedMessageListWithContext = <
217217
}
218218

219219
return (
220-
<Message<At, Ch, Co, Ev, Me, Re, Us>
220+
<Message
221221
groupedByUser={
222222
shouldGroupByUser &&
223223
streamMessageIndex > 0 &&

0 commit comments

Comments
 (0)