From e7eb2bd6f08169745e80dbee2f9039c662422992 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Mon, 16 Nov 2020 08:42:57 +0100 Subject: [PATCH] fix(radiosfield): prevent css to apply on plain html radios Signed-off-by: Thierry Bugier --- css/styles.css | 16 ++++++++-------- inc/field/radiosfield.class.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/css/styles.css b/css/styles.css index 9d7f57542..d21b4fba6 100644 --- a/css/styles.css +++ b/css/styles.css @@ -389,7 +389,7 @@ form#plugin_formcreator_form { } #plugin_formcreator_form input[type = checkbox]:focus + label, -#plugin_formcreator_form input[type = radio]:focus + label, +#plugin_formcreator_form input[type = radio].new_radio:focus + label, #plugin_formcreator_form input[type = file]:focus { color: #66afe9; color: rgba(102,175,233, 1); @@ -430,31 +430,31 @@ form#plugin_formcreator_form { .radios .form-group-radio + label { margin-left: 7px; } -input[type = radio] { +input[type = radio].new_radio { display: none; } .label-radio .radio { padding: 2px 0; } -input[type = radio] + label.label-radio span { +input[type = radio].new_radio + label.label-radio span { display: inline-block; position: absolute; width: 16px; height: 16px; } -input[type = radio] + label.label-radio .box { +input[type = radio].new_radio + label.label-radio .box { background-color: #fff; border: 2px solid #727272; border-radius: 50%; } -input[type = radio] + label.label-radio .check { +input[type = radio].new_radio + label.label-radio .check { left: 4px; top: 4px; width: 0px; height: 0px; opacity: 0; } -input[type = radio]:checked + label.label-radio .check { +input[type = radio].new_radio:checked + label.label-radio .check { border: 6px solid #727272; border-radius: 50%; transition: opacity 0.3s ease; @@ -1099,7 +1099,7 @@ a.plugin_formcreator_formTile_title { opacity: 1; color: #3874BC; } -.plugin_formcreator_sort:hover .radios input[type = radio] + label:before { +.plugin_formcreator_sort:hover .radios input[type = radio].new_radio + label:before { background-color: #3874BC; border: 2px solid #3874BC; } @@ -1110,7 +1110,7 @@ a.plugin_formcreator_formTile_title { text-align: left; margin: 0 20px; } -.plugin_formcreator_sort .radios input[type = radio] + label { +.plugin_formcreator_sort .radios input[type = radio].new_radio + label { display: inline-block; margin-right: 10px; } diff --git a/inc/field/radiosfield.class.php b/inc/field/radiosfield.class.php index 3572fa124..dbec35e1d 100644 --- a/inc/field/radiosfield.class.php +++ b/inc/field/radiosfield.class.php @@ -119,7 +119,7 @@ public function getRenderedHtml($canEdit = true) { $html .= ''; $html .= Html::input($fieldName, [ 'type' => 'radio', - 'class' => 'form-control', + 'class' => 'new_radio form-control', 'id' => $domId . '_' . $i, 'value' => $value ] + $checked);