Adding a mention can clear the message box and erase the undo history

Description

Original report: https://github.com/mattermost/mattermost-server/issues/17130

Summary
Adding a mention can clear the message box and erase the undo history

Steps to reproduce
1. Draft a message (don't post yet).
2. Add an at-mention at the start of the draft, by moving the text cursor to the very beginning of the message and type "@" and a username drop-down appears.
3. Now, while this drop-down is visible, if I accidentally press either ← or → once causing the text cursor to move, and then select a username from the drop-down, then — BAM! — everything after the text cursor is gone, which in this case is the entire message (and the selected username isn't inserted either).
4. Even worse, CTRL + Z to undo does nothing, because (and perhaps this should be considered a second bug) the entire undo history is erased when clicking on a username from the drop-down.

Expected behavior
I'm expecting Mattermost to not delete the messages I'm composing, and if they're deleted, then I expect undo to be available.

QA Test Steps

None

Activity

Show:
Amy Blais
March 15, 2021, 8:05 PM

It's not new in v5.32 or v5.33, not sure how far back it goes.

Jesse Hallam
March 15, 2021, 8:04 PM

, do you know if this is a recent regression, or can we reproduce going back a few versions?

Mana

None

Assignee

Unassigned

QA Assignee

None

Reporter

Amy Blais

Epic Link

None

Fix versions

Mattermost Team

Web Platform

Sprint

None

Labels

QA Testing Areas

None

GitHub Issue

None

Components

None

Severity

None