I experienced the same problem on a different phone before. What I did is I installed a 3rd party keyboard app. Try it and let me know if that fixes the problem.