Closing only open dropdowns

Instead of iterating every dropdown, we're closing only the open ones.