Skip to content
Snippets Groups Projects

Fix unit display when only 1 option is present

Merged aron novak requested to merge issue/physical-3360344:3360344-widget-should-use into 8.x-1.x
2 files
+ 4
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -126,12 +126,13 @@ class Dimensions extends FormElement {
$last_visible_element = 'height';
$unit_keys = array_keys($units);
$unit = reset($unit_keys);
$unit_label = $units[$unit];
$element['unit'] = [
'#type' => 'value',
'#value' => $unit,
];
// Display the unit as a text element after the textfield.
$element['height']['#field_suffix'] = $unit;
$element['height']['#field_suffix'] = $unit_label;
}
else {
$last_visible_element = 'unit';
Loading