diff --git a/src/components/base-address/BaseAddress.vue b/src/components/base-address/BaseAddress.vue index 2660fceb..980de099 100644 --- a/src/components/base-address/BaseAddress.vue +++ b/src/components/base-address/BaseAddress.vue @@ -228,24 +228,25 @@ export default class BaseAddress extends Mixins(ValidationMixin, CountriesProvin readonly isInactive: boolean /** Called, possibly externally, to validate all registered form inputs. */ - public validate (): any { + public async validate (): Promise { this.postalCodeRulesEnabled = true + await Vue.nextTick() // ensure postal code rules are functional before validating return this.$refs.addressForm.validate() } /** Called, possibly externally, to reset validation of all registered form inputs and clear their values. */ - public reset (): any { + public reset (): void { this.postalCodeRulesEnabled = false return this.$refs.addressForm.reset() } /** Called, possibly externally, to reset validation of all registered form inputs without modifying their values. */ - public resetValidation (): any { + public resetValidation (): void { return this.$refs.addressForm.resetValidation() } /** When country changes, resets fields. */ - onCountryChange () { + onCountryChange (): void { this.addressLocal['addressRegion'] = '' this.addressLocal['postalCode'] = '' // clear any existing validation errors diff --git a/src/components/completing-party/CompletingParty.vue b/src/components/completing-party/CompletingParty.vue index 12c3d8e0..c3678820 100644 --- a/src/components/completing-party/CompletingParty.vue +++ b/src/components/completing-party/CompletingParty.vue @@ -219,9 +219,9 @@ export default class CompletingParty extends Vue { /** When prop changes, validate the components. */ @Watch('validate') - private onValidate (): void { + private async onValidate (): Promise { this.$refs.completingPartyForm && this.$refs.completingPartyForm.validate() - this.$refs.mailingAddress && this.$refs.mailingAddress.validate() + this.$refs.mailingAddress && await this.$refs.mailingAddress.validate() } /** When prop changes, update local object. */