Properly selects a typeahead input (when specified).