Closing chat clears the typed message

What the title says really.

It’s a long habit of mine to possibly press ESC to close a chat so that I may quickly type something new.
I just think it’d be cleaner to have closing chat clear what was typed, and say you wanted to save the message, you could just copy paste it, as I usually do that before clearing as the situation is usually:

I’d go to type something, something else gets said and I wish to respond to that first, so I copy the message and say that first, then paste the message and finish it afterwards