Added property to preserve state and zip values for use on service-location page

This commit is contained in:
Leah Schumann 2023-04-26 09:10:27 -04:00
parent 4697398d10
commit 176d51634b
2 changed files with 11 additions and 4 deletions

View file

@ -45,7 +45,7 @@
<div class="row mb-4" v-show="showAddressFields" aria-live="polite">
<div class="col">
<dropdownQuestion
customInputId="state"
customDropdownId="state"
cmsWidgetName="StateQuestionWidget"
v-model="addressModel.state"
ref="state"
@ -115,6 +115,10 @@ export default {
type: Boolean,
default: false,
},
preserveCityAndStateOnReset: {
type: Boolean,
default: false,
},
},
data() {
return {
@ -390,8 +394,10 @@ export default {
this.displayNoMatchWarning = true;
this.addressModel.city = "";
this.addressModel.state = "";
this.addressModel.zipCode = "";
if (!this.preserveCityAndStateOnReset) {
this.addressModel.state = "";
this.addressModel.zipCode = "";
}
this.showAddressFields = true;
this.displayVerificationWarning = false;

View file

@ -37,7 +37,8 @@
<addressQuestions
ref="addressQuestions"
v-model="internalModel.addressQuestions"
captureApartmentNumberOrBusinessName="true" />
captureApartmentNumberOrBusinessName="true"
preserveCityAndStateOnReset="true"/>
<vehicleProtectedQuestion
ref="vehicleProtectedQuestion"
v-model="internalModel.isVehicleProtected"