-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix(recaptcha): various optimizations #3631
Conversation
10072da
to
9d3a932
Compare
3036508
to
ba6f10f
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.
@chickenn00dle all is working well, and the rendering of the widgets/hidden fields during field focus is seamless and causes no detectable form layout changes or delays in form submission. 🎉
The only thing I see is that when displaying the v2 widget on the modal checkout second screen, the modal is no longer scrolling up to bring it into the viewport. As a reader, if I don't know to expect a reCAPTCHA v2 widget, it's hard to tell what's happening as the form inside modal simply becomes greyed-out and non-interactive. Could we ensure that if the widget is displayed, we're scrolling the modal viewport so that it's visible?
Also, I pushed 80cb850 because I saw an issue in my local environment while testing this in which the site key/secret fields in the admin dashboard were appearing empty even though I knew the data existed in my site DB. |
That's odd. On my end it looks to be scrolling: Screen.Recording.2024-12-16.at.16.52.21.mov |
This PR replaces the default recaptcha failure alert behavior with generic errors appended to the relevant forms.
80cb850
to
c66d116
Compare
fe03f44 restores a couple of lines from #3283 which trigger a re-render of v2 widgets when Woo checkout fires |
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.
This is working now on my end, and because it's in response to some time-sensitive publisher requests, I'm going to go ahead and merge without a second PR reviewer. 🤞
🎉 This PR is included in version 5.10.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Closes https://app.asana.com/0/1207817176293825/1208950357031079/f
This PR makes some optimizations to our recaptcha implementation:
How to test the changes in this Pull Request:
data-recaptcha-widget-id
attribute. There should be nonedata-recaptcha-widget-id
attribute. The button in the focused form should have this.g-recaptcha-response
.Testing recaptcha errors:
To test auto-retry on recaptcha error, you can force the error callback by replacing this line with
callback: errorCallback
:newspack-plugin/src/other-scripts/recaptcha/index.js
Line 177 in ba6f10f
Other information: