In-game chat filed looses selection after some time. I have to click on it to be able to close it by pressing enter. I guess code should contain additional checks or boolean variables for opened/closed chat field.
Did not find in-game user interface forum