This happens regularly on my Boost Mobile MOTO G 3G, Android 4.4.4.
I have three keyboards, Google, Ginger and Keypass2Android. It happens on all of them, including staying visible but totally locking up. I wonder if it has anything to do with CPU temp?