When that happens, hit the Shift key. This isn't an issue if you close the chat window before bringing up the Steam overlay.