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='') -%} {% macro TextInput(field, placeholder='') -%}
<div class='usa-input {% if field.errors %}usa-input--error{% endif %}'> <div class='usa-input {% if field.errors %}usa-input--error{% endif %}'>
<label for={{field.name}}> <label for={{field.name}}>
@ -7,9 +9,7 @@
<span class='usa-input__help'>{{ field.description | safe }}</span> <span class='usa-input__help'>{{ field.description | safe }}</span>
{% endif %} {% endif %}
{% if errors %} {% if field.errors %}{{ Icon('alert') }}{% endif %}
{{ Icon('alert') }}
{% endif %}
</label> </label>
{{ field(placeholder=placeholder) | safe }} {{ field(placeholder=placeholder) | safe }}