Move caret only if input has focus