diff --git a/templates/components/text_input.html b/templates/components/text_input.html index b620cf35..b4c990a9 100644 --- a/templates/components/text_input.html +++ b/templates/components/text_input.html @@ -1,14 +1,18 @@ {% from "components/icon.html" import Icon %} {% macro TextInput(field, placeholder='', validation='anything', paragraph=False) -%} - + + + v-bind:class="['usa-input usa-input--validation--' + validation, { 'usa-input--error': showError, 'usa-input--success': showValid }]" + class='usa-input {% if field.errors %}usa-input--error{% endif %}'> {{ field.label }} - {% if field.description %} {{ field.description | safe }} {% endif %} @@ -27,8 +31,9 @@ @@ -38,15 +43,16 @@ + {% if field.errors %}aria-invalid='true'{% endif %}> {% endif %}