Skip to content

Commit 0e8c61c

Browse files
committed
only change country when lib has a possible value
1 parent 0ec47c3 commit 0e8c61c

File tree

1 file changed

+3
-3
lines changed
  • projects/packages/forms/src/modules/field-phone

1 file changed

+3
-3
lines changed

projects/packages/forms/src/modules/field-phone/view.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ const { actions } = store( NAMESPACE, {
6666
context.phoneCountryCode = asYouTypes[ fieldId ].getCountry();
6767
context.phoneNumber = asYouTypes[ fieldId ].getNationalNumber();
6868
asYouTypes[ fieldId ] = new AsYouType( context.phoneCountryCode );
69+
context.countryPrefix = countries.find(
70+
item => item.code === context.phoneCountryCode
71+
)?.value;
6972
} else {
7073
context.phoneNumber = value;
7174
}
72-
context.countryPrefix = countries.find(
73-
item => item.code === context.phoneCountryCode
74-
)?.value;
7575
context.fullPhoneNumber = context.countryPrefix + ' ' + context.phoneNumber;
7676
actions.updateField( fieldId, value );
7777
},

0 commit comments

Comments
 (0)