Skip to content

Commit

Permalink
fix(radiosfield): better overlap prevention
Browse files Browse the repository at this point in the history
when labels needs several lines to show

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Feb 5, 2020
1 parent 8f57d8d commit a2f1ed1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ form.formcreator_form {
cursor: pointer;
padding-left: 22px;
position: relative;
display: block;
display: inline-block;
height: 26px;
}
.formcreator_radios input[type = radio] + label:before,
Expand Down
8 changes: 2 additions & 6 deletions inc/fields/radiosfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ public function displayField($canEdit = true) {
$rand = mt_rand();
$fieldName = 'formcreator_field_' . $id;
$domId = $fieldName . '_' . $rand;
// echo '<input type="hidden" class="form-control"
// name="' . $fieldName . '"
// id="' . $domId . '"
// value="" />' . PHP_EOL;

$values = $this->getAvailableValues();
if (!empty($values)) {
Expand All @@ -105,15 +101,15 @@ public function displayField($canEdit = true) {
if ((trim($value) != '')) {
$i++;
$checked = ($this->value == $value) ? ' checked' : '';
echo '<p>';
echo '<input type="radio" class="form-control"
name="' . $fieldName . '"
id="' . $domId . '_' . $i . '"
value="' . $value . '"' . $checked . ' /> ';
echo '<label for="' . $domId . '_' . $i . '">';
echo $value;
echo '</label>';
echo '<br/>';
echo '<br/>';
echo '</p>';
}
}
echo '</div>';
Expand Down

0 comments on commit a2f1ed1

Please sign in to comment.