Toggle: only close grouped elements that are open

Prevents unnecessary `toggled` events from firing on elements that are already closed.