Restore focus on input field after mode change and dialog hide