Text box contains “Hi @username,” and a newline. Also, the username autocompletion box should go away after typing the comma.
Actual result:
Text box contains “Hi @username” and no newline. In other words, because the autocomplete stayed open after typing the comma, the <enter> was interpreted as selecting the username from the autocomplete. This wipes out the comma, and means that no newline is inserted.
I have added a check on the client side to ensure that the search term is validated using same rule as on the server side (specifically UsernameValidator.username_char_valid?).