diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index a041d5965..7353fe0b3 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -137,13 +137,6 @@ export default { // Reset the validation form this.$refs[this.modalName].form.resetForm(); - // { - // values: { - // state: this.modelValue.addressQuestions.state, - // zipCode: this.modelValue.addressQuestions.zipCode, - // }, - // dirty: false, - // }); // Reinitialize the Address Auto Complete this.$refs.addressQuestions.setupAddressLookup(); @@ -164,6 +157,7 @@ export default { async setMobileLocation() { // TODO: Any lookups or actions to be taken before assigning the Mobile Location + // Update the page level model this.$emit("update:modelValue", this.internalModel); this.closeModal(); diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue index ccb0c5111..b80f6107f 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-modal-question.vue @@ -38,15 +38,6 @@ import serviceZipQuestion from "@/layouts/service-location/service-zip-modal-que import modal from "@/digital-components/modal/modal"; import alert from "@/ux-components/alert/alert"; -//Supporting Files -import { defineRule, useForm } from "vee-validate"; -import { required, regex } from "@/helpers/validation-rules"; -import { errorMessages } from "@/constants/error-messages"; - -// Define Validation Rules -// defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); -// defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT)); - export default { name: "service-zip-modal-question", data() { @@ -85,14 +76,6 @@ export default { modalName() { return this.modalWidgetName; }, - // serviceZipModel: { - // get: function () { - // return this.modelValue; - // }, - // set: function (newValue) { - // this.$emit("update:modelValue", newValue); - // }, - // }, }, methods: { resetAlerts() { @@ -105,7 +88,8 @@ export default { }, focusOnZipInput() { - const input = document.getElementById("serviceZipCodeTextBoxQuestion"); + const inputId = this.$refs.serviceZipQuestion.$refs.zipInputTextQuestion.inputId; + const input = document.getElementById(inputId); input.focus(); }, @@ -125,15 +109,9 @@ export default { this.$refs[this.modalName].closeModal(); }, - // onModalOpened() { - // this.serviceZipCodeInput = this.serviceZipModel.zipCode; - // this.focusOnZipInput(); - // }, - - // onModalClosed() { - // this.serviceZipCodeInput = this.serviceZipModel.zipCode; - // this.resetsOnZipInput(); - // }, + onModalOpened() { + this.focusOnZipInput(); + }, async setZipCode() { this.resetAlerts(); @@ -147,14 +125,10 @@ export default { this.internalModel.state = zipCodeData.state; this.internalModel.isServiceable = zipCodeData.isServiceable; - // if the service zip code is changing we need to clear the Mobile Location Model - if ( - this.modelValue.zipCode !== "" && - this.internalModel.zipCode !== this.modelValue.zipCode - ) { - this.$emit("service-zip-updated"); - } - + // Notify the page that the service zip has been updated to clear Mobile Location form + this.$emit("service-zip-updated"); + + // Update the page level model this.$emit("update:modelValue", this.internalModel); this.closeModal(); diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-question.vue index 99064425f..fb5b7be7e 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-question.vue +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-question.vue @@ -5,8 +5,7 @@ v-model="value" inputId="serviceZipCode" questionAlignment="center" - mask="#####" - :preventAutoFill="true" + mask="#####" :displayQuestionText="false" isRequired validationRules="zip-required|zip-format" />