From c4aa209413394e771f3bf8d1073f45873bc620ab Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Wed, 16 Jul 2025 15:19:15 -0400 Subject: [PATCH] Fix issue where answer was not auto selected If it was not in the initial three questions it didn't load correctly --- .../shop-question/shop-question-popup.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index df2d0dace..c28307e0a 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -14,6 +14,7 @@ ref="shopQuestionModal" :headerText="modalHeaderText" :onModalClosedCallback="onModalClosed" + :onModalOpenedCallback="updateSelectedAnswer" :footerButtonText="modalFooterText" :footerButtonDisabled=" displayInvalidZipAlert || displayNoShopsAlert || !localSelectedProviderNumber @@ -165,9 +166,11 @@ export default { openModal() { // Reset local state from parent this.localShopProviderData = this.shopProviderDataFromParent; - this.localSelectedProviderNumber = this.selectedProviderNumberFromParent; this.localZipCode = this.zipCodeFromParent; this.answers = []; + // This will be set once the modal is open (updateSelectedAnswer()) to ensure that the + // correct answer is selected + this.localSelectedProviderNumber = null; const selectedProviderNumberFromParentIndex = this.shopProviders.findIndex( (provider) => provider.providerNumber == this.selectedProviderNumberFromParent @@ -183,6 +186,9 @@ export default { this.$refs.shopQuestionModal.openModal(); }, + updateSelectedAnswer() { + this.localSelectedProviderNumber = this.selectedProviderNumberFromParent; + }, updateShopListWithNextShops(numberToGet = 3) { //gaAction = this.GaActions.SHOPS_FIRST_DISPLAYED; --This needs to actually fire on initial display, can never happen here