We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a0838e commit afda1c3Copy full SHA for afda1c3
templates/input/form-element.html.twig
@@ -61,7 +61,8 @@
61
is_radio ? 'radio',
62
is_checkbox ? 'checkbox',
63
is_autocomplete ? 'form-autocomplete',
64
- has_error ? 'error has-error'
+ has_error ? 'error has-error',
65
+ required ? 'required',
66
]
67
%}{%
68
set description_classes = [
wxt_bootstrap.theme
@@ -338,3 +338,12 @@ function wxt_bootstrap_preprocess_paragraph(&$variables) {
338
$variables['link_provider_label'] = $allowed_values[$key] ?? $key;
339
}
340
341
+
342
+/**
343
+ * Implements hook_preprocess_form_element().
344
+ */
345
+function wxt_bootstrap_preprocess_form_element(array &$variables) {
346
+ if (!empty($variables['element']['#required'])) {
347
+ $variables['required'] = TRUE;
348
+ }
349
+}
0 commit comments