-
Notifications
You must be signed in to change notification settings - Fork 35
Description
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
- Open an editor with
mentionIndicators={["@"]}enabled. - Type
@and select a user from the suggestion list — mention is finalized (e.g.@johndoe). - 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