Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This resets the country code correctly when using $refs.form.reset
  • Loading branch information
Tofandel authored Jan 25, 2022
1 parent 2b5328d commit b967a47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/vue-tel-input-vuetify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ export default {
},
},
mounted() {
this.$watch('$refs.countryInput.isResetting', (v) => v && this.reset());
this.initializeCountry()
.then(() => {
if (
Expand Down Expand Up @@ -758,6 +759,7 @@ export default {
}
},
reset() {
this.countryCode = this.activeCountry;
this.selectedIndex = this.sortedCountries
.map(c => c.iso2)
.indexOf(this.activeCountry.iso2);
Expand Down

0 comments on commit b967a47

Please sign in to comment.