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.