Hey HivePress team,
I’ve found a minor ‘bug’ that would be great if you’re able to help fix!
Under HivePress > Settings > on the Listings & Vendors tabs, under ‘Social Links’ I have enabled WhatsApp. However, unlike when I add a phone number ‘attribute’; I’m unable to select the ‘Default Country’.
While I was using another theme, I found I was able to ‘fix’ the issue with a custom script, but since reverting to using Listing Hive my ‘fix’ seems to have stopped working no matter where I place it.
I’d guess this is only a very small issue for you guys to fix, so hopefully you can push out a quick update soon. I’ve attached the snippet I was using previously below in case it’s of any use to anyone:
<script>
document.addEventListener('DOMContentLoaded', function() {
function setPhoneCountry() {
const phoneInput = document.querySelector('input[data-intl-tel-input-id="1"]');
if (phoneInput && typeof window.intlTelInput !== 'undefined') {
let iti = window.intlTelInputGlobals.getInstance(phoneInput);
if (!iti) {
iti = window.intlTelInput(phoneInput, {
initialCountry: 'gb',
utilsScript: phoneInput.getAttribute('data-utils')
});
} else {
iti.setCountry('gb');
}
return true;
}
return false;
}
if (!setPhoneCountry()) {
let attempts = 0;
const interval = setInterval(function() {
if (setPhoneCountry() || attempts >= 10) {
clearInterval(interval);
}
attempts++;
}, 500);
}
});
</script>
Cheers,
Chris