Issue
I am using select tag to select country list. When I open the form to edit the country, first it shows the saved country perfectly fine but after 1-2 seconds it changes back to whatever the first option there is!
resluts when i Open the form to edit:
after 1-2 seconds(it is changing back to first option):
here is my html code:
<select id="Country" class="form-select custom-input" formControlName="country"
(change)="getStateList()"
[ngClass]="{ 'is-invalid': submitted && f.country.errors }">
<option [value]="null" disabled>Select country</option>
<option *ngFor="let country of countryList"
[value]="country?._source?.countryISOCode">
{{country?._source?.countryName}}</option>
</select>
please tell me if you need any more code, image or information regarding this.
Solution
I was calling the getCountryList() for two times that's why the first option was being selected after few seconds!
Answered By - JAYESHKUMAR KATHROTIYA
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.