close the dropdown on selection of an option

If only one option is available, select it and close the dropdown instead for user to click somewhere outide to close it