Repository navigation
Phone field with intl-tel-input #568
Unanswered
mortenthogersen
asked this question in
Feature Requests
Replies: 7 comments 7 replies
|
Would love to upvote this multiple times. |
0 replies
|
Has anyone had a crack at implementing their own telephone number component? |
0 replies
|
Hi guys, I created this as a start. I am now deporting all the array as config files, I'll work on the validation after. It might interests you @kyranb , @amitsamtani , @mortenthogersen <flux:input.group
x-data="{
countryCode: '+33',
masks: {
'+33': '99 99 99 99 99',
'+1': '(999) 999-9999',
'+44': '99 9999 9999',
'+49': '9999 9999999'
},
placeholders: {
'+33': '01 23 45 67 89',
'+1': '(555) 123-4567',
'+44': '20 1234 5678',
'+49': '1234 5678901'
},
getPhoneMask(input) {
return this.masks[this.countryCode] || '999999999999';
}
}"
class="flex items-center"
>
<flux:select
x-model="countryCode"
class="mr-0 max-w-fit w-fit"
wire:model="form.country_code"
>
<flux:select.option value="+33">+33 (FR)</flux:select.option>
<flux:select.option value="+1">+1 (US)</flux:select.option>
<flux:select.option value="+44">+44 (UK)</flux:select.option>
<flux:select.option value="+49">+49 (DE)</flux:select.option>
</flux:select>
<flux:input
wire:model="form.phone"
name="form.phone"
type="tel"
required
x-mask:dynamic="getPhoneMask($input)"
x-bind:placeholder="placeholders[countryCode] || 'Enter number'"
class="w-full"
/>
</flux:input.group>Maybe @joshhanley can be interested for docs..? Best |
1 reply
|
Any News about this feature request ? |
0 replies
|
I've put something together. There is a CSS dependency in the code for the flags. phone-input-demo.webm |
5 replies
|
Hi, when it will be merged? I'm waiting to use it |
1 reply
|
I hope this gets the love, now the flags are here @calebporzio 🤔 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Implement the intl-tel-input package (https://github.com/jackocnr/intl-tel-input) to create a full-featured phone input component that would:
All reactions