{"action":"created","issue":{"url":"https://api.github.com/repos/jackocnr/intl-tel-input/issues/803","repository_url":"https://api.github.com/repos/jackocnr/intl-tel-input","labels_url":"https://api.github.com/repos/jackocnr/intl-tel-input/issues/803/labels{/name}","comments_url":"https://api.github.com/repos/jackocnr/intl-tel-input/issues/803/comments","events_url":"https://api.github.com/repos/jackocnr/intl-tel-input/issues/803/events","html_url":"https://github.com/jackocnr/intl-tel-input/issues/803","id":371526994,"node_id":"MDU6SXNzdWUzNzE1MjY5OTQ=","number":803,"title":"separateDialCode: true  bug","user":{"login":"olexbondarenko","id":7649632,"node_id":"MDQ6VXNlcjc2NDk2MzI=","avatar_url":"https://avatars0.githubusercontent.com/u/7649632?v=4","gravatar_id":"","url":"https://api.github.com/users/olexbondarenko","html_url":"https://github.com/olexbondarenko","followers_url":"https://api.github.com/users/olexbondarenko/followers","following_url":"https://api.github.com/users/olexbondarenko/following{/other_user}","gists_url":"https://api.github.com/users/olexbondarenko/gists{/gist_id}","starred_url":"https://api.github.com/users/olexbondarenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olexbondarenko/subscriptions","organizations_url":"https://api.github.com/users/olexbondarenko/orgs","repos_url":"https://api.github.com/users/olexbondarenko/repos","events_url":"https://api.github.com/users/olexbondarenko/events{/privacy}","received_events_url":"https://api.github.com/users/olexbondarenko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-18T13:20:07Z","updated_at":"2018-11-14T16:40:05Z","closed_at":"2018-10-18T13:26:46Z","author_association":"NONE","body":"### Steps to reproduce\r\n1.  set separateDialCode: true\r\n\r\n### Expected behaviour\r\nWhen selecting a country code, the selected should appear.\r\n\r\n### Actual behaviour\r\nWhen you select a country code, the selected one is added to the current one.\r\n\r\n### Initialisation options\r\nI use:\r\n           initialCountry: \"auto\",\r\n            separateDialCode: true,\r\n            dropdownContainer: document.body.querySelector(\".intl-tel-input allow-dropdown\"),\r\n            preferredCountries: [\"us\", \"gb\", \"dk\", \"de\"],\r\n            geoIpLookup: function(success, failure) {\r\n               jQuery.get(\"https://ipinfo.io\", function() {}, \"jsonp\").always(function(resp) {\r\n                    var countryCode = (resp && resp.country) ? resp.country : \"\";\r\n                    success(countryCode);\r\n                });\r\n            },\r\n\r\nI fixed this in my project.\r\nI add **this.t.innerText = \"\";** , before **this.t.appendChild(g)**\r\n\r\nexample code: \r\n\r\nif (this.selectedFlag.setAttribute(\"title\", d), this.b.separateDialCode) {\r\n            var e = this.s.dialCode ? \"+\" + this.s.dialCode : \"\", f = this.a.parentNode;\r\n            c.dialCode && f.classList.remove(\"iti-sdc-\" + (c.dialCode.length + 1)), e && f.classList.add(\"iti-sdc-\" + e.length);\r\n            var g = b.createTextNode(e);\r\n            **this.t.innerText = \"\";**\r\n            this.t.appendChild(g)\r\n          }"},"comment":{"url":"https://api.github.com/repos/jackocnr/intl-tel-input/issues/comments/438729905","html_url":"https://github.com/jackocnr/intl-tel-input/issues/803#issuecomment-438729905","issue_url":"https://api.github.com/repos/jackocnr/intl-tel-input/issues/803","id":438729905,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODcyOTkwNQ==","user":{"login":"jackocnr","id":1186883,"node_id":"MDQ6VXNlcjExODY4ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/1186883?v=4","gravatar_id":"","url":"https://api.github.com/users/jackocnr","html_url":"https://github.com/jackocnr","followers_url":"https://api.github.com/users/jackocnr/followers","following_url":"https://api.github.com/users/jackocnr/following{/other_user}","gists_url":"https://api.github.com/users/jackocnr/gists{/gist_id}","starred_url":"https://api.github.com/users/jackocnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackocnr/subscriptions","organizations_url":"https://api.github.com/users/jackocnr/orgs","repos_url":"https://api.github.com/users/jackocnr/repos","events_url":"https://api.github.com/users/jackocnr/events{/privacy}","received_events_url":"https://api.github.com/users/jackocnr/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T16:40:05Z","updated_at":"2018-11-14T16:40:05Z","author_association":"OWNER","body":"You just need to upgrade to the latest version to get the fix."}}
{"actor":{"display_login":"jackocnr"}}