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

Skip to content

Commit 1928faf

Browse files
committed
feature #26330 [FORM] Fix HTML errors. (Nyholm)
This PR was merged into the 4.1-dev branch. Discussion ---------- [FORM] Fix HTML errors. | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | As mentioned in #26328. Range and color do not support "required" attribute Commits ------- f75d8c1 Fix HTML errors.
2 parents 4c98001 + f75d8c1 commit 1928faf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
{%- block form_widget_simple -%}
1212
{%- set type = type|default('text') -%}
13+
{%- if type == 'range' or type == 'color' -%}
14+
{# Attribute "required" is not supported #}
15+
{%- set required = false -%}
16+
{%- endif -%}
1317
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
1418
{%- endblock form_widget_simple -%}
1519

0 commit comments

Comments
 (0)