Try this way
Do you have this problem on every place your type? or just Whatsapp?
I mean, do you have the problem while typing an Eamil or it is just Whatsapp?
If so, try re installing Whatsapp!
But if the problem still persists on all the apps, I think try restarting the phone, and first thing you do after booting is typing! (To see if the phone is having enough free Ram and memory or not)
and if it is not working either, I would go for a factory reset