I think google introduced a new feature where you have to accept for your cursor to be locked in one place, so you need to allow that when it pops up, but if you did that and it still happens, it may be because when you press esc to go to the pause menu it also takes the focus away from the game window so you need to press the resume button on the pause menu to refocus and also block the cursor in the middle once again, hope this helped.