Place error icon next to text input box

This commit is contained in:
luis cielak 2018-08-08 23:34:26 -04:00
parent cb2b9faa42
commit e981ef917a

View File

@ -1,3 +1,5 @@
{% from "components/icon.html" import Icon %}
{% macro TextInput(field, placeholder='') -%}
<div class='usa-input {% if field.errors %}usa-input--error{% endif %}'>
<label for={{field.name}}>
@ -7,9 +9,7 @@
<span class='usa-input__help'>{{ field.description | safe }}</span>
{% endif %}
{% if errors %}
{{ Icon('alert') }}
{% endif %}
{% if field.errors %}{{ Icon('alert') }}{% endif %}
</label>
{{ field(placeholder=placeholder) | safe }}
@ -20,4 +20,4 @@
{% endfor %}
{% endif %}
</div>
{%- endmacro %}
{%- endmacro %}