Skip to content
Snippets Groups Projects
Commit d48153c8 authored by Alberto Siles's avatar Alberto Siles Committed by Alberto Siles
Browse files

Issue #3281993 by Monster971, hatuhay: Enable the Floating labels in forms

parent 031b67af
No related branches found
Tags 5.5.7
No related merge requests found
......@@ -434,7 +434,11 @@ function bootstrap_barrio_preprocess_form_element(&$variables) {
}
}
if (theme_get_setting('bootstrap_barrio_float_label') && $variables['element']['#type'] != 'search') {
if (theme_get_setting('bootstrap_barrio_float_label') &&
$variables['element']['#type'] != 'radio' &&
$variables['element']['#type'] != 'checkbox' &&
$variables['element']['#type'] != 'search' &&
$variables['element']['#type'] != 'managed_file') {
$variables['float_label'] = theme_get_setting('bootstrap_barrio_float_label');
$variables['label_display'] = 'after';
}
......@@ -749,7 +753,10 @@ function bootstrap_barrio_preprocess_input(&$variables) {
}
$variables['safe_value_label'] = Xss::filter($variables['attributes']['value']);
}
if ($variables['element']['#type'] == 'textfield' &&
if ($variables['element']['#type'] != 'radio' &&
$variables['element']['#type'] != 'checkbox' &&
$variables['element']['#type'] != 'managed_file' &&
$variables['element']['#type'] != 'search' &&
theme_get_setting('bootstrap_barrio_float_label') &&
!isset($variables['attributes']['placeholder'])) {
$variables['attributes']['placeholder'] = $variables['element']['#title'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment