RocketChat / RocketChat/EmbeddedChat
Mention autocomplete triggers on email addresses
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 165
- Forks
- 381
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
The mention popup in ChatInput fires whenever you type @ after a space. Problem is, that also matches email addresses — typing something like contact admin @example.com pops up the member list and starts filtering against "example.com".
The trigger logic in useSearchMentionUser.js:23-26:
if (
lastChar === '@' &&
(message.length === 1 || message[message.length - 2] === ' ')
)
It checks "is this an @ after a space?" but doesn't try to figure out whether the user is mentioning someone or just typing an email.
Steps to reproduce:
- Open EmbeddedChat in any room
- In the message input, type
contact admin @example.com - The mention popup appears as soon as you hit
@ - It filters members against "example.com"
Expected behavior:
Mention popup shouldn't fire when the user is typing an email address.
Actual behavior:
Popup fires on any @ preceded by a space. You have to dismiss it or ignore it while finishing the email.
Code reference:
packages/react/src/hooks/useSearchMentionUser.js:23-26
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/react/src/hooks/useSearchMentionUser.js:23-26 and inspect how the ChatInput trigger is detected after a space. Reproduce the email-address example in an EmbeddedChat room, then verify that the mention popup still appears for intended mentions but not while typing an email address.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 64/100