public function errorElement(array $element, ConstraintViolationInterface $error, array $form, FormStateInterface $form_state) {
// Validation errors might be a about a specific (behavior) form element
// attempt to find a matching element.
if (!empty($error->arrayPropertyPath) && ($sub_element = NestedArray::getValue($element, $error->arrayPropertyPath))) {
return $sub_element;
}
return $element;
}