This is just the UI's bad programming. The Confirm key is prone to focus issues. There's nothing you can do except press ESC a few times when you're having this problem, which should remove focus from the chat box and any other windows that might be open (the loot window or loot notification are particularly guilty of asserting focus at times that I don't want it to).