Skip to content

Beautiful Open-Source Form Builder

Refactor PhoneInput component to simplify country code selection logic (#904)

Chirag Chhatrala495a71d5719f
diff --git a/client/components/forms/heavy/PhoneInput.vue b/client/components/forms/heavy/PhoneInput.vue
index 8eb3421dc..f25dd30d5 100644
--- a/client/components/forms/heavy/PhoneInput.vue
+++ b/client/components/forms/heavy/PhoneInput.vue
@@ -201,10 +201,7 @@ export default {
const phoneObj = parsePhoneNumber(this.compVal)
if (phoneObj !== undefined && phoneObj) {
if (phoneObj.country !== undefined && phoneObj.country) {
- // Respect manual selection; infer only when none is set
- if (!this.selectedCountryCode) {
- this.selectedCountryCode = this.getCountryBy(phoneObj.country)
- }
+ this.selectedCountryCode = this.getCountryBy(phoneObj.country)
}
this.inputVal = phoneObj.nationalNumber
}