Update valid prop on MultiCheckboxInput to return true if the field is optional
This commit is contained in:
parent
62cdcbe6dc
commit
20a2abd36b
@ -14,6 +14,7 @@ export default {
|
|||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
initialOtherValue: String,
|
initialOtherValue: String,
|
||||||
|
optional: Boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
@ -45,7 +46,7 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
valid: function() {
|
valid: function() {
|
||||||
return this.showValid
|
return this.optional || this.showValid
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
{% if other_input_field and other_input_field.data and other_input_field.data != "None" %}
|
{% if other_input_field and other_input_field.data and other_input_field.data != "None" %}
|
||||||
initial-other-value="{{ other_input_field.data }}"
|
initial-other-value="{{ other_input_field.data }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
v-bind:optional={{ optional|lower }}
|
||||||
key='{{ field.name }}'>
|
key='{{ field.name }}'>
|
||||||
<div
|
<div
|
||||||
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
v-bind:class="['usa-input', { 'usa-input--error': showError, 'usa-input--success': showValid }]">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user