On Minecraft 1.12 and earlier versions, Using Alt+Tab to switch windows while doing typing anything in a chat window keeps whatever is in the chat (Tested with 1.12.2). On 18w01a (and possibly earlier, haven't tested this), it clears the chat window, though. This becomes annoying when, for example, referencing forums or wikis for information on how to use a command.
Related issues
Comments

Yup. I had it in fullscreen mode (Forgot to add that in there). The current workaround, then, is to use Minecraft in windowed mode, or is there a workaround that will let me stay in fullscreen mode?
Windowed mode 👍
Cannot reproduce. Does MC-258 describe your issue?