Persist text input for the field

This commit is contained in:
Montana
2019-01-04 09:57:23 -05:00
parent c5007d9edb
commit 62ac2642ae
3 changed files with 7 additions and 5 deletions

View File

@@ -1,12 +1,13 @@
{% from "components/icon.html" import Icon %}
{% from "components/tooltip.html" import Tooltip %}
{% macro MultiCheckboxInput(field, tooltip, inline=False) -%}
{% macro MultiCheckboxInput(field, other_input_field, tooltip, inline=False) -%}
<multicheckboxinput
name='{{ field.name }}'
inline-template
{% if field.errors %}v-bind:initial-errors='{{ field.errors | list }}'{% endif %}
{% if field.data and field.data != "None" %}v-bind:initial-value="{{ field.data }}"{% endif %}
{% if other_input_field.data and other_input_field.data != "None" %}v-bind:initial-other-value="{{ other_input_field.data }}"{% endif %}
key='{{ field.name }}'>
<div
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
@@ -37,7 +38,7 @@
<label for='{{ field.name }}-{{ field.choices.index(choice) }}'>{{ choice[1] }}</label>
<div v-show="otherChecked">
<input type='text' name='{{ field.name}}_other' id='{{ field.name }}-other' aria-expanded='false'/>
<input type='text' name='{{ field.name}}_other' id='{{ field.name }}-other' value="{{ other_input_field.data }}" aria-expanded='false' />
</div>
{% endif %}
</li>