International Telephone Input with Vue
## Issue This PR addresses issue #390: [Country does not update sometimes when selecting another country]. The issue was related to the active country not updating in the dropdown when modifying the input and changing the country. ## Proposed Changes I've made the following changes to address this issue: - Modified the watch for `phoneObject.countryCode` to update the `activeCountryCode` only if `value` is true. This ensures that the `activeCountryCode` is updated when there's a valid value. The updated code looks like this: ```javascript 'phoneObject.countryCode': function (value) { if (value) { this.activeCountryCode = value; } }, ``` ## How to reproduce/test the issue First, update your configuration like this- ``` autoFormat - false dropdownOptions.showDialCodeInSelection - true dropdownOptions.showSearchBox - true ``` 1. Select any country in the dropdown, or leave the default country as is. 2. Try to modify the phone number (plus sign should not be included) 3. Now, try to change the country. 4. You should see that the country does not update on the first click, later it will update. 5. If the country updates successfully without any issues, repeat steps 2 & 3 a few times. You will notice the bug in a few trials. ### Recorded behavior of the bug- https://github.com/iamstevendao/vue-tel-input/assets/145762828/48efb258-f2c9-438a-9a13-7c1eab46bbd9 ### Recorded behavior after fixing the bug- https://github.com/iamstevendao/vue-tel-input/assets/145762828/a738a7d3-5324-455b-8ccf-fc862fb155de ## Related issues #390 ## Checklist - [x] I have tested this PR and confirmed that it resolves the issue.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by neha-proxima and has received 4 comments.