Fixed close dropdowns bug

Fixed bug that stopped dropdowns from closing when clicking outside of
a dropdown.