From 78b4190c379cb2373738f2e228e1f69ef6afc600 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 26 Apr 2023 08:17:36 -0400 Subject: [PATCH] Now auto-selecting the 'Mobile' option when it is the only option --- .../appointment-type-question.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue index 6260df9d1..664b55674 100644 --- a/src/layouts/service-location/appointment-type-question/appointment-type-question.vue +++ b/src/layouts/service-location/appointment-type-question/appointment-type-question.vue @@ -66,6 +66,18 @@ export default { }, }, watch: { + answersToDisplay: { + handler(newValue) { + // If there is only one option to display and that option is 'Mobile' then select it + if ( + newValue.length == 1 && + newValue.findIndex((answer) => answer.Name == "Mobile") != -1 + ) { + this.selectedValues = "Mobile"; + } + }, + immediate: true, + }, isMobileOnly: { handler(newValue) { if (newValue) {