diff --git a/core/lib/Drupal/Core/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php
index 1f39e10..c564896 100644
--- a/core/lib/Drupal/Core/Render/Element/RenderElement.php
+++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php
@@ -204,6 +204,12 @@ public static function preRenderGroup($element) {
       }
     }
 
+    // Set attributes to indicate that there is a child with an error.
+    if (!empty($element['#children_errors'])) {
+      $element['#attributes']['class'][] = 'error';
+      $element['#attributes']['aria-invalid'] = 'true';
+    }
+
     return $element;
   }
 
diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js
index c7ad2fd..94821e3 100644
--- a/core/misc/vertical-tabs.js
+++ b/core/misc/vertical-tabs.js
@@ -60,7 +60,8 @@
           var $that = $(this);
           var vertical_tab = new Drupal.verticalTab({
             title: $that.find('> summary').text(),
-            details: $that
+            details: $that,
+            children_errors: $that.hasClass('error')
           });
           tab_list.append(vertical_tab.item);
           $that
@@ -246,6 +247,11 @@
         .append(tab.summary = $('<span class="vertical-tabs__menu-item-summary"></span>')
         )
       );
+
+    if (settings.children_errors) {
+      tab.item.addClass('error');
+    }
+
     return tab;
   };
 
