Laptop? Perhaps you're inadvertently brushing the touchpad with your thumb
or sleeve, or the sensitivity of the touchpad may be set too high and just
typing is enough to activate it. This will cause focus to be set to the
current cursor location, which may be anywhere on the page - especially if
you've accidentally brushed the touchpad.