-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync phone changes with WooPay phone field #9464
base: develop
Are you sure you want to change the base?
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +158 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I type a Brazilian phone number the country code changes back to US when the input loses focus
Screen.Recording.2024-09-19.at.13.48.49.mov
When I autofill the opt-in phone number the page jumps to the billing address fields
When I autofill the billing address after I typed the opt-in it gets removed
Screen.Recording.2024-09-19.at.13.54.35.mov
When the number gets copied from the billing address it does not change the country flag
Screen.Recording.2024-09-19.at.13.57.15.mov
@leonardola fixed on 9b3b991. |
// Update the phone number when the billing phone is updated. | ||
useEffect( () => { | ||
if ( isCustomerDataUpdating ) { | ||
setTimeout( () => { | ||
setPhoneNumber( getPhoneFieldValue() ); | ||
}, 0 ); | ||
} | ||
}, [ | ||
billingAddressPhone, | ||
setPhoneNumber, | ||
getPhoneFieldValue, | ||
isCustomerDataUpdating, | ||
] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used this approach due to inconsistencies when using the blur event and autofill.
Fixes #9431
Changes proposed in this Pull Request
When removing the focus of the billing address phone field, automatically update the WooPay phone number.
Testing instructions
Securely save my information for 1-click checkout
.Force the pre_check_save_my_info flag (aka Default Opt-in) in the account cache to be true
).npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge