Automatically hides dropdowns after selecting an option