Open ahmedConrad opened 3 years ago
I am using a reactive form in angular 12 with this component. When I supply a value using formControl.patchValue('+12345552'), the sorting order of countries gets messed up.
formControl.patchValue('+12345552')
I was able find the code which is causing the issue https://github.com/webcat12345/ngx-intl-tel-input/blob/58096ab0f31576632c8c3e56d5c29c8c93ccd96f/projects/ngx-intl-tel-input/src/lib/ngx-intl-tel-input.component.ts#L232-L237
Since sorting in javascript happens in-place, it changes the original array.
I am using a reactive form in angular 12 with this component. When I supply a value using
formControl.patchValue('+12345552')
, the sorting order of countries gets messed up.I was able find the code which is causing the issue https://github.com/webcat12345/ngx-intl-tel-input/blob/58096ab0f31576632c8c3e56d5c29c8c93ccd96f/projects/ngx-intl-tel-input/src/lib/ngx-intl-tel-input.component.ts#L232-L237
Since sorting in javascript happens in-place, it changes the original array.