Replies: 4 comments 1 reply
-
Ended up looking at the source code. Setting the property <MazPhoneNumberInput
v-model="inputVal"
:defaultCountryCode="CA"
:placeholder="label"
:preferred-countries="['CA', 'US']"
showCodeOnList
/> Though I now see a new issue whereby if component is passed a phone number with another country prefix, then it won't update. For example, '+33493244480'. |
Beta Was this translation helpful? Give feedback.
-
Hi @ajmas, I'm sorry that the documents generated with JSDocs in the component was broken, it's fixed now. You can check out all props, events and slots : https://louismazel.github.io/maz-ui-3/components/maz-phone-number-input#props-event-slots About your issue, the props <template>
<MazPhoneNumberInput
v-model="inputVal"
v-model:country-code="inputCountryCode"
placeholder="label"
:preferred-countries="['CA', 'US']"
show-code-on-list
/>
</template>
<script lang="ts" setup>
const inputCountryCode = ref('CA')
const inputVal = ref('+33493244480')
</script> |
Beta Was this translation helpful? Give feedback.
-
But, keep in mind, by default the country code is deduced from the browser language. And if you want to prefer to use the user's IP geolocation (provided by https://ipwho.is), you can use the So, in the majority of cases, it is preferable not to set a country code by default |
Beta Was this translation helpful? Give feedback.
-
Thanks. The documentation is much more readable now. There is certainly a mismatch between my geography and my browser language settings, though done to get preferred date and time formatting. I had kinda forgotten about that, but suspected some locale assumptions were happening. I’ll look into the IP based approach and also check whether it works with IPv6 based addresses. |
Beta Was this translation helpful? Give feedback.
-
When I use MazPhoneNumberInput and the field is empty, the country code is showing '+44' by default. It isn't clear from the documentation how I change the default country code to be something else? I
did try putting '+1' in the
v-model
, but that just ends up putting '+1' in the typeable area without changing the codenote, using 3.29.9 and component
maz-ui/components/MazPhoneNumberInput
. Project is Quasar based.Beta Was this translation helpful? Give feedback.
All reactions