Open leachtucker opened 7 months ago
Hello !
Hum I'm waiting for more upvote because I for my personal POV, I've never seen an tel input like this. I don't really know the usecase for that.
But thanks for your PR <3
Ty
Hello !
Hum I'm waiting for more upvote because I for my personal POV, I've never seen an tel input like this. I don't really know the usecase for that.
But thanks for your PR <3
Ty
Sounds good! Usually on the web, you would either find one input which supports the addition of extensions. Or, two inputs--one for the main number and one for the extension. Here, we technically have two but they act as one, which is convenient when integrating with a form. Anyhow, will keep an eye on this PR -- I am confident others have a use-case as well since extensions are relatively common for B2B.
Hi, we've been looking for this as well and it seems like a good idea :)
Hey @viclafouch. Any word on this?
Hello !
Hum I'm waiting for more upvote because I for my personal POV, I've never seen an tel input like this. I don't really know the usecase for that.
But thanks for your PR <3
Ty
Dear @viclafouch
You are right, This type of tel input is not common case for general use cases in B2C application like social network web pages, online stores and etc.
This type of input is common on enterprise web application like ERP applications CRM or admin panels, for example when you register the company as an entity, in contact details they generally have only one phone line and many extensions. when you need to call finance department you will call that phone number and ext: 101 for Sales Ext:102, Fax Ext: 103 and so on. this feature is very useful for enterprise application and B2B use cases.
We've been looking for this as well and seems the implementation is good.
Thanks
Hello !
Could you please fix the conflicts in order to merge the PR ;)
Hey @viclafouch, PR is fixed up. Should be ready for merge 👍
@viclafouch Waiting on a release with this change
Description
Adds support for inputting extensions via an additional input field.
Why
This library is incredibly useful yet it lacks support for entering extensions which is commonplace in the B2B world.
Changes
onChange
callback.Considerations
The formatted value passed to the
onChange
callback of MuiTelInput adheres to Google's development style guide on phone numbers.Google's Dev Style Guide
Due to the As You Type formatter not supporting extensions, the extension feature requires some additional layers of indirection and complexity in number parsing and formatting. As the complexity of the
usePhoneDigits
hook is growing, it is beginning to warrant some refactoring in order to improve code readability.https://github.com/catamphetamine/libphonenumber-js