From 20a2abd36b7d322b1450930775e94de87f2d3382 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Fri, 22 Nov 2019 09:33:39 -0500 Subject: [PATCH] Update valid prop on MultiCheckboxInput to return true if the field is optional --- js/components/multi_checkbox_input.js | 3 ++- templates/components/multi_checkbox_input.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/js/components/multi_checkbox_input.js b/js/components/multi_checkbox_input.js index 8ef4e880..fdba839f 100644 --- a/js/components/multi_checkbox_input.js +++ b/js/components/multi_checkbox_input.js @@ -14,6 +14,7 @@ export default { default: () => [], }, initialOtherValue: String, + optional: Boolean, }, data: function() { @@ -45,7 +46,7 @@ export default { computed: { valid: function() { - return this.showValid + return this.optional || this.showValid }, }, } diff --git a/templates/components/multi_checkbox_input.html b/templates/components/multi_checkbox_input.html index 40fb3d7a..2f2c65ec 100644 --- a/templates/components/multi_checkbox_input.html +++ b/templates/components/multi_checkbox_input.html @@ -11,6 +11,7 @@ {% if other_input_field and other_input_field.data and other_input_field.data != "None" %} initial-other-value="{{ other_input_field.data }}" {% endif %} + v-bind:optional={{ optional|lower }} key='{{ field.name }}'>