[frontend] Auto-select first element when a modal pops up