Fix custom select rendering

[MAILPOET-2652]
This commit is contained in:
Pavel Dohnal
2020-01-22 14:19:36 +01:00
committed by Jack Kitterhing
parent 0932f7c985
commit ffc82eff69

View File

@@ -17,7 +17,11 @@ class Select extends Base {
$html .= '<select class="mailpoet_select" name="' . $fieldName . '" ' . $automationId . '>'; $html .= '<select class="mailpoet_select" name="' . $fieldName . '" ' . $automationId . '>';
if (isset($block['params']['label_within']) && $block['params']['label_within']) { if (isset($block['params']['label_within']) && $block['params']['label_within']) {
$html .= '<option value="">' . static::getFieldLabel($block) . '</option>'; $label = static::getFieldLabel($block);
if (!empty($block['params']['required'])) {
$label .= ' *';
}
$html .= '<option value="" disabled selected hidden>' . $label . '</option>';
} else { } else {
if (empty($block['params']['required']) || !$block['params']['required']) { if (empty($block['params']['required']) || !$block['params']['required']) {
$html .= '<option value="">-</option>'; $html .= '<option value="">-</option>';