Skip to content

Mention detection has some bugs #571

@SMhdAsadi

Description

@SMhdAsadi

Describe the bug

There appear to be issues with both mention-related callbacks:

1. onMentionEnd

onMentionEnd is not triggered immediately after the mention ends. Instead, it seems to wait until multiple spaces are entered, then fires only after typing a subsequent non-space character.

2. onMentionDetected

onMentionDetected does not detect the mention indicator (@) correctly.

Instead, it appears to fire when selecting any word, regardless of whether it is a mention. This causes false positives and makes the callback unreliable for mention handling.


To Reproduce

  1. Open the example app.
  2. Navigate to TestScreen.
  3. Add console.log() statements to onMentionEnd and onMentionDetected.
  4. Type text containing mentions.
  5. Observe the callback behavior.

Expected behavior

onMentionEnd

Expected to fire immediately after the mention is terminated (for example, after the first space following @john).

Potentially, mention termination could also happen on special characters such as ., ,, (, ), $, ^, etc., depending on intended behavior.

onMentionDetected

Expected to fire when the mention trigger character (@) is typed and mention parsing begins.

It should not fire for unrelated word selections or non-mention text.


Screenshots / Recordings

onMentionEnd issue

Screen.Recording.2026-04-26.at.16.26.15.mov

onMentionDetected issue

Screen.Recording.2026-04-26.at.16.28.13.mov

Environment

  • Device: Emulator
  • OS: Android 16
  • Library version: 0.6.1

Additional context

Tested on the example app included in the repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions