Skip to content

Android: mention suggestion list re-opens after a mention is finalized #490

@Jianlong-Nie

Description

@Jianlong-Nie

Description

On Android, after a user selects a mention from the suggestion list, typing new characters after the finalized mention causes the suggestion list to re-open unexpectedly.

Steps to Reproduce

  1. Open an editor with mentionIndicators={["@"]} enabled.
  2. Type @ and select a user from the suggestion list — mention is finalized (e.g. @johndoe ).
  3. Continue typing any characters after the mention (e.g. hello).

Expected: The suggestion list stays closed — the mention is already resolved.
Actual: The suggestion list re-opens as if a new mention search is being triggered.

Root Cause

afterTextChangedMentions in ParametrizedStyles.kt uses a previousWord fallback: when the cursor moves into a new word after the mention, it looks back, finds @johndoe as the previous word, and since it matches mentionRegex, it fires onMention again.

iOS does not have this issue because it uses a conflictingStyles / manageMentionEditing mechanism that blocks events when the cursor is inside or adjacent to a finalized mention span.

Expected Behavior

Once a mention span is finalized, text changes adjacent to it should not trigger onMention. The behaviour should mirror iOS.

Platform

  • Android only
  • iOS works correctly

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