This is browser behavior (maybe even OS behavior!), You probably won't find a way to stop it with javascript.
It is designed to hide the cursor so that you can see what you are typing. Try it on any website, keystrokes always make the mouse cursor go away.
source share