Skip to content

Mention autocomplete triggers on email addresses #1287

Description

@deepak0x

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:

  1. Open EmbeddedChat in any room
  2. In the message input, type contact admin @example.com
  3. The mention popup appears as soon as you hit @
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions