Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b953e85

Browse files
committed
bug #26328 [Form][WCAG] Fixed HTML errors (Nyholm)
This PR was squashed before being merged into the 3.4 branch (closes #26328). Discussion ---------- [Form][WCAG] Fixed HTML errors | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | According to my friend and WCAG2 expect [Sandra](https://twitter.com/sandrability): > Fix your HTML errors. Should I fix the same issues on other forms as well? Or could someone claim that is a BC break? Commits ------- fe66819 [Form][WCAG] Fixed HTML errors
2 parents 4261b19 + fe66819 commit b953e85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
{% if type is not defined or type != 'hidden' %}
104104
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control' ~ (type|default('') == 'file' ? '-file' : ''))|trim}) -%}
105105
{% endif %}
106+
{%- if type is defined and (type == 'range' or type == 'color') %}
107+
{# Attribute "required" is not supported #}
108+
{%- set required = false -%}
109+
{% endif %}
106110
{{- parent() -}}
107111
{%- endblock form_widget_simple %}
108112

0 commit comments

Comments
 (0)