Skip to content

Commit a2f1ed1

Browse files
committed
fix(radiosfield): better overlap prevention
when labels needs several lines to show Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 8f57d8d commit a2f1ed1

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

css/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ form.formcreator_form {
345345
cursor: pointer;
346346
padding-left: 22px;
347347
position: relative;
348-
display: block;
348+
display: inline-block;
349349
height: 26px;
350350
}
351351
.formcreator_radios input[type = radio] + label:before,

inc/fields/radiosfield.class.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ public function displayField($canEdit = true) {
9292
$rand = mt_rand();
9393
$fieldName = 'formcreator_field_' . $id;
9494
$domId = $fieldName . '_' . $rand;
95-
// echo '<input type="hidden" class="form-control"
96-
// name="' . $fieldName . '"
97-
// id="' . $domId . '"
98-
// value="" />' . PHP_EOL;
9995

10096
$values = $this->getAvailableValues();
10197
if (!empty($values)) {
@@ -105,15 +101,15 @@ public function displayField($canEdit = true) {
105101
if ((trim($value) != '')) {
106102
$i++;
107103
$checked = ($this->value == $value) ? ' checked' : '';
104+
echo '<p>';
108105
echo '<input type="radio" class="form-control"
109106
name="' . $fieldName . '"
110107
id="' . $domId . '_' . $i . '"
111108
value="' . $value . '"' . $checked . ' /> ';
112109
echo '<label for="' . $domId . '_' . $i . '">';
113110
echo $value;
114111
echo '</label>';
115-
echo '<br/>';
116-
echo '<br/>';
112+
echo '</p>';
117113
}
118114
}
119115
echo '</div>';

0 commit comments

Comments
 (0)