fix: improve a11y of checkbox with tooltip
This commit is contained in:
@@ -94,15 +94,17 @@
|
|||||||
{%- if form.vars.attr.tooltip is defined -%}
|
{%- if form.vars.attr.tooltip is defined -%}
|
||||||
{%- set tooltip = form.vars.attr.tooltip -%}
|
{%- set tooltip = form.vars.attr.tooltip -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<div class="{{ html_classes('relative flex items-start', { 'cursor-not-allowed': form.vars.attr.readonly is defined }) }}"{% if tooltip is not null %} {{ stimulus_controller('tooltip', { 'content': tooltip }) }}{% endif %}>
|
<div>
|
||||||
<div class="flex h-6 items-center">
|
<div class="{{ html_classes('relative flex items-start', { 'cursor-not-allowed': form.vars.attr.readonly is defined }) }}"{% if tooltip is not null %} {{ stimulus_controller('tooltip', { 'content': tooltip }) }}{% endif %}>
|
||||||
{{ form_widget(form) }}
|
<div class="flex h-6 items-center">
|
||||||
</div>
|
{{ form_widget(form) }}
|
||||||
<div class="{{ html_classes('ml-1 leading-6', { 'text-red-500': errors|length }) }}">
|
</div>
|
||||||
<label for="{{ form.vars.id }}" class="{{ html_classes({ 'pointer-events-none': form.vars.attr.readonly is defined }) }}">
|
<div class="{{ html_classes('ml-1 leading-6', { 'text-red-500': errors|length }) }}">
|
||||||
{{ form.vars.label | raw }}
|
<label for="{{ form.vars.id }}" class="{{ html_classes({ 'pointer-events-none': form.vars.attr.readonly is defined }) }}">
|
||||||
</label>
|
{{ form.vars.label | raw }}
|
||||||
{{- form_errors(form) -}}
|
</label>
|
||||||
|
{{- form_errors(form) -}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user