diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index 719d2d681..823ce79fd 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -125,15 +125,6 @@ export default { } }, }, - beforeUpdate(){ - const exceptions = ["Windshield", "Crack"]; - const firstItem = typeof(this.answers[0]) === 'object' ? this.answers[0] : this.answers[0]; - if(Array.isArray(this.answers) && this.answers.length === 1 && !exceptions.includes(typeof(firstItem) === 'object' ? firstItem.Text : firstItem)) { - const newSelectedValues = this.selectedValues; - newSelectedValues.push(typeof(firstItem) === 'object' ? firstItem.Name : firstItem); - this.selectedValues = newSelectedValues; - } - }, methods: { handleCheckedChanged(val) { if(this.isMultiSelect) { diff --git a/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue b/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue index 6f2606597..f47abea5d 100644 --- a/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue +++ b/src/layouts/vehicle-damage/replace-options-question/replace-options-question.vue @@ -70,6 +70,13 @@ export default ({ : []; }, }, + mounted(){ + if(Array.isArray(this.answersToDisplay) && this.answersToDisplay.length === 1) { + const newSelectedValues = this.selectedValues; + newSelectedValues.push(this.answersToDisplay[0].Name); + this.selectedValues = newSelectedValues; + } + }, components: { buttonQuestion, }