Resetting subitems state when closing the parent.