Skip to content

[Bug][Android] Deleting the auto-inserted trailing space after a mention strips the mention to plain text #691

Description

@lukasz-patalan

Describe the bug

On Android, deleting the trailing whitespace that is automatically inserted after a completed mention removes the mention (its span is stripped and it becomes plain text). Once stripped, the span is never restored, so the text stays as a regular @uniqueTag string with no mention styling and no tag in the emitted HTML.

To Reproduce

  • The mention is inserted as @XYZ followed by an auto-inserted trailing space @XYZ
  • Press backspace once to delete that trailing space.
  • The mention loses its styling and turns into plain text; the emitted HTML no longer contains a tag.

onChangeHtml output across the steps:

after selecting the user (note trailing space)

<p><mention text="@pelargonia0001-test1" indicator="@" userId="user_3DIRyZz9CM7JO7VMsti66T83vKD" uniqueTag="pelargonia0001-test1">@pelargonia0001-test1</mention> </p>                                                                                                                                        

after deleting the trailing space (mention gone)

<p>@pelargonia0001-test1</p>     

Expected behavior

Deleting whitespace adjacent to a completed mention should not silently strip the mention. The mention should either stay intact or be deleted as a whole atomically (as it behaves on iOS).

Video:

Screen_Recording_20260710-162052_HOBB.Dev.mp4

Device:

Device: Android (reproducible on both physical device and emulator)
OS: Android

Additional context

Reproducible 100% on Android; not reproducible on iOS, where editing a mention removes the whole mention range instead of leaving orphaned plain text.
Pressing Enter right after the mention does not trigger it; only editing that reaches into the mention's word range does (e.g. deleting the trailing space).

Metadata

Metadata

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions