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: {