-
Notifications
You must be signed in to change notification settings - Fork 219
Ensure input is validated when autofilled in Firefox #11062
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.53 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.
@opr Thank you for working on it. The changes looks good. However, I couldn't test the PR. For some reasons, the address field is getting disabled for me. I tried commenting out the ValidateInput
to check if it is caused by this change but no dice. It's happening on trunk as well. Maybe something wrong with my local. I'll test the PR again tomorrow.
Here is the screen recording:
Screen.Recording.2023-09-29.at.12.30.32.AM.mov
This PR has been marked as If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label. |
6658cbd
to
f32d116
Compare
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.
@opr Thank you for the change! The input validation error has been resolved.
Repeat again without closing the window, when you load the Checkout block the second time, the details should be auto filled based on your last order.
When I was trying to order again, it already had a saved address. We might need to update the testing instructions or find another way to test this.
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.
Works as expected. 🎉
f32d116
to
5e34e0f
Compare
What
Ensures the
validateInput
function is fired when aValidatedTextInput
gets its value autofilled in Firefox.Why
For some reason there seems to be a race condition where inputs get validated before the
useEffect
that handles autofill/direct changes to the data store in Chrome. This PR causes validation to run when the input is updated via data store or autofill.Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
Perform these steps both in Firefox and Chrome/Brave/Edge
Screenshots or screencast
n/a
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog