Update international code as user types phone#1568
Conversation
There was a problem hiding this comment.
typo: Internaional -- instead of Interna__t__ional
|
I'm testing this locally and it's not doing what I think it should be doing.
|
There was a problem hiding this comment.
This line is missing a closing square bracket after the closing single quote. It's what's causing the tests to fail. Interestingly, Chrome doesn't complain about this, but Safari does.
I've pulled in
This is not introduced by the changes in this PR. I plan on addressing that issue in #1571 since that will touch the form code where the bug lives. I've also changed some of the JS to get this to work on the update user form phone. Everything should be ready for another round of 👀s |
|
Failing specs 🙃. Flipping back to WIP. Once sec |
|
Specs are ✅. Now this is ready for another set of 👀s |
**Why**: It is confusing that the international code selection and the number in the phone input can be out of sync. This commit keeps both in sync by updating them as the user types. This also helps make sure the format of phone number makes a little more sense. Use libphonenumber-js to format intl numbers **Why**: The phone number formatter built into field-kit does not know how to format international numbers. This commit abandons that phone formatter in favor of a custom formatter built on top of libphonenumber-js which does know how to format international numbers. Format phone numbers on update user phone form **Why**: This change gives users the same experience typing numbers and selecting international codes that they get from the 2FA setup form.
ff1a97e to
0733a6d
Compare
Why: It is confusing that the international code selection and the
number in the phone input can be out of sync. This commit keeps both in
sync by updating them as the user types. This also helps make sure the
format of phone number makes a little more sense.