Cursor changes position in input line after I highlight some text to overwrite it My problem is that when I highlight some text (doesn't matter where or in which application) in order to write over it the cursor, sometimes, suddenly changes position causing a lot of typos.

Let's say I've searched the phrase "stack exchange apple" in Google.

Now I want to search for stack overflow so I first highlight "exchange" and "apple" this way:



and then I simply type "overflow" in order to write over the highlighted text. What I sometimes end up with is this:



And I can assure you that I didn't press any arrow keys or trackpad or mouse button of sort. I simply wrote in the keyboard "overflow" but what happened is that after I pressed "O" the cursor changed position and the word ended up like this.

I'm running macOS Sierra v10.12.4 on a Mid-2014 15" Macbook Pro

Are there things that can fail or settings to help with this?
The most likely culprit once you rule out Bluetooth mouse / trackpad and any wrist or liquid input is hardware. 

If you can reproduce this on a clean os install onto an external drive (to avoid wiping your normal drive and files and apps) it could be:


failing battery pressing underneath the trackpad
failing or damaged capacitive sensing grid 
failing chip that processes the capacitive touch sensor


It's unlikely to be software, but I'd still download and install a clean and updated os to be sure unless you have close and easy access to hardware service.