Hitting escape while replying in a discussion drops the reply.
Summary
Hitting the escape key while redacting a response in a discussion in an issue closes the textarea and the response is lost without warning.
Steps to reproduce
- Create a new issue
- Start a discussion
- Reply to the discussion by clicking the "Reply..." textarea to expand it.
- Type anything
- Hit your "escape" key (physical key on the keyboard)
- The textarea shrinks and the text is lost
What is the current bug behavior?
It may look like a feature to close the textarea when pressing escape, but losing a lengthy text is always a bummer.
What is the expected correct behavior?
Use the same behavior we have for merge requests. When hitting escape:
- if the comment is empty, clear and close the textarea
- if it has any content, show the following browser alert to confirm clearing the comment:
Even though having the alert is not the best experience, let's stick to it for the sake of consistency.
Additional informations
Personally, I hit escape to close the smiley picker, which pops when, in french, I enter a column after a space, like:
Et voila à quoi ça ressemble :
But instead of closing the smiley picker, it closes the whole textarea. Maybe a fix would be to close the smiley picker if it's opened, and close the textarea as it's currently implemented if no smiley picker is opened, again, UX question.