Browse Source

Merge pull request #7086 from ArtemDzhereleiko/AD/bug-fix/phone-input-code

[3.4.1] UI: Fixed bug with double calling code
pull/7097/head
Igor Kulikov 4 years ago
committed by GitHub
parent
commit
5f5cf7cec7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui-ngx/src/app/shared/components/phone-input.component.ts

2
ui-ngx/src/app/shared/components/phone-input.component.ts

@ -142,7 +142,7 @@ export class PhoneInputComponent implements OnInit, ControlValueAccessor, Valida
this.getFlagAndPhoneNumberData(value);
let phoneNumber = this.phoneFormGroup.get('phoneNumber').value;
if (phoneNumber) {
if (code !== this.countryCallingCode && phoneNumber.includes(code)) {
if (code !== '+' && code !== this.countryCallingCode && phoneNumber.includes(code)) {
phoneNumber = phoneNumber.replace(code, this.countryCallingCode);
this.phoneFormGroup.get('phoneNumber').patchValue(phoneNumber);
}

Loading…
Cancel
Save