Reposition dialog before focusing on it, so scrolling does not happen prematurely.