Added watch on addressModel so that when all fields have been populated after garbage is entered into autocomplete we clear out the No Match warning

This commit is contained in:
Leah Schumann 2022-04-14 08:37:09 -04:00
parent 73745fd24a
commit c65794f847

View file

@ -5,19 +5,19 @@
</div> </div>
</div> </div>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<div class="address-fields" v-show="showAddressFields" aria-live="polite"> <div class="row my-4" v-show="showAddressFields" aria-live="polite">
<div class="row my-4"> <div class="col">
<div class="col"> <textboxQuestion cmsWidgetName="CityQuestionWidget" v-model="addressModel.city" ref="city" inputId="cbf28188fdf2436688fd735915f7ee56" disableAutoFill validationRules="city-required"/>
<textboxQuestion cmsWidgetName="CityQuestionWidget" v-model="addressModel.city" ref="city" inputId="cbf28188fdf2436688fd735915f7ee56" disableAutoFill validationRules="city-required"/>
</div>
</div> </div>
<div class="row my-4"> </div>
<div class="col-6"> </transition>
<dropdownQuestion cmsWidgetName="StateQuestionWidget" v-model="addressModel.state" ref="state" inputId="8fdf9dc2e13e430eb57529499dceb3eb" :options="stateOptions" disableAutoFill validationRules="state-required" /> <transition name="fade" mode="out-in">
</div> <div class="row my-4" v-show="showAddressFields" aria-live="polite">
<div class="col-6"> <div class="col">
<textboxQuestion cmsWidgetName="ZipQuestionWidget" v-model="addressModel.zip" ref="zip" inputId="01a9a1c2de0b4c9da8e023c9ae3be498" mask="#####" disableAutoFill validationRules="zip-required|zip-format"/> <dropdownQuestion cmsWidgetName="StateQuestionWidget" v-model="addressModel.state" ref="state" inputId="8fdf9dc2e13e430eb57529499dceb3eb" :options="stateOptions" disableAutoFill validationRules="state-required" />
</div> </div>
<div class="col">
<textboxQuestion cmsWidgetName="ZipQuestionWidget" v-model="addressModel.zip" ref="zip" inputId="01a9a1c2de0b4c9da8e023c9ae3be498" mask="#####" disableAutoFill validationRules="zip-required|zip-format"/>
</div> </div>
</div> </div>
</transition> </transition>
@ -251,6 +251,17 @@ export default ({
mounted() { mounted() {
this.setupAddressLookup(); this.setupAddressLookup();
}, },
watch: {
addressModel: {
handler(newValue){
if (newValue.streetAddress && newValue.city && newValue.state && newValue.zip)
{
this.displayNoMatchWarning = false;
}
},
deep: true
}
},
components: { components: {
textboxQuestion, textboxQuestion,
dropdownQuestion, dropdownQuestion,