Skip to content

Commit

Permalink
DecimanUnitType: make it possible to append CSS class
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaszGasior committed Sep 26, 2020
1 parent c0fc05b commit 21d5550
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/common/form/custom_types.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
{% endblock integer_unit_widget %}

{% block decimal_unit_widget %}
{% set attr = attr|merge({'class': 'decimal', 'step': step, 'min': step}) %}
{% set attr = attr|merge({
'class': attr.class|default('') ~ ' decimal',
'step': step,
'min': step,
}) %}
{{ block('integer_unit_widget') }}

{# Enforce leading zeros in typed values ("87.6" -> "87.60"). #}
Expand Down

0 comments on commit 21d5550

Please sign in to comment.