Try this:

press enter, write a text, press ESC.
The text stays in the chat line, but isn't posted.
This is ok.
But now, to chat again you have to press enter, and at that point the previous line you pressed ESC on, is posted...