Fixes: #17083 - Wrap labels in a div to reduce inadvertently clickable area to their left in forms (#17525)

* Wrap labels in a div to reduce inadvertently clickable area to their left in forms

* Set form label to be inline-block
This commit is contained in:
bctiemann 2024-09-19 13:07:36 -04:00 committed by GitHub
parent 6d0a3485a1
commit 8deaaae44b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,9 +6,11 @@
{# Render the field label (if any), except for checkboxes #}
{% if label and not field|widget_type == 'checkboxinput' %}
<label for="{{ field.id_for_label }}" class="col-sm-3 col-form-label text-lg-end{% if field.field.required %} required{% endif %}">
{{ label }}
</label>
<div class="col-sm-3 text-lg-end">
<label for="{{ field.id_for_label }}" class="col-form-label d-inline-block{% if field.field.required %} required{% endif %}">
{{ label }}
</label>
</div>
{% endif %}
{# Render the field itself #}