Draw overlays for input elements before focusing in focusInput

This prevents us from drawing the overlays in the wrong place if the window scrolls to focus the chosen input (eg. when it is on the boundary of the page). Fixes #1257.
Is that really best?  The visual feedback also serves to show the user what happened. It may be best to revert this and consider it separately.