Just started a few days ago. New phone bought on March 19th on T-mobile. Samsung Galaxy S7 edge. I didn't notice and updates and have removed all recent apps and checked everything I could. It only does it when I use it in email or text messaging apps such as the built in phone messenger and Facebook messenger. If I used talk to text in google search I had no issues. I reset everything to default that I could think of, removed a bunch of apps, took it out of developer mode, cleaned up and changed my keyboard back to the default from google, rebooted and it was still doing it after all that.
Oddly enough after hours of research and changing things, it started working properly this morning. Unless there was an update that happened over night that fixed it, I have no clue what I could have switch to fix it.