Optional autofocus on selection

I added an optional parameter for autofocus on selection