From 266137f871625994c68c74ff79cfba4ccd122827 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 2 Feb 2022 16:27:47 -0500 Subject: [PATCH] changing check change method to take specific value --- src/common-components/button-question/button-question.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 6031061ab..7b9654139 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -108,13 +108,14 @@ export default { if(Array.isArray(this.answers) && this.answers.length === 1) { this.modelValueAnswers.push(typeof(this.answers[0]) === 'object' ? this.answers[0].Name : this.answers[0]); this.$emit("update:modelValue", this.modelValueAnswers); - }; + } }, methods: { handleCheckedChanged(val) { // Add or remove item to array of data to emit val.isChecked ? this.modelValueAnswers.push(val.buttonId) : this.modelValueAnswers.splice(this.modelValueAnswers.indexOf(val.buttonId), 1); - this.$emit("update:modelValue", this.modelValueAnswers.length ? this.modelValueAnswers : undefined); + const answersToEmit = this.modelValueAnswers.length ? this.modelValueAnswers : undefined; + this.$emit("update:modelValue", answersToEmit); }, }, components: {