-
Notifications
You must be signed in to change notification settings - Fork 826
Forms: Use Core buttons instead of Jetpack buttons #45007
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
base: trunk
Are you sure you want to change the base?
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 3 files.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
[ | ||
'core/button', | ||
{ | ||
text: __( 'Contact Us', 'jetpack-forms' ), |
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.
text: __( 'Contact Us', 'jetpack-forms' ), | |
text: __( 'Contact us', 'jetpack-forms' ), |
Good time to switch to sentence case while we're here.
Although this would need E2E update in calypso 🤦
Great thing about using core buttons is that they will soon also support pseudo classes like |
Replaces usage of the custom jetpack/button block with the core/buttons and core/button blocks for submit actions in the contact form. Updates block variations, editor logic, and server-side rendering to support and enhance compatibility with core/buttons, including interactivity attributes and error handling. This change improves alignment with WordPress core blocks and future-proofs the contact form implementation.
Introduces a spinner animation to the submit button when the form is submitting by adding CSS for a loading indicator and keyframes for the spinner effect.
Co-authored-by: Mikael Korpela <[email protected]>
be0699e
to
04ea827
Compare
Rebased |
I noticed a couple of things while testing this PR.
Nice work Miguel! |
That was more of a hack. The idea is that you should use one of the stacking blocks, like columns or rows. Since we are using core buttons, we should take advantage of how they interact with those core layout blocks now. |
Can we use the core button without its container? Separately, do I remember wrong or does WP templating allow limiting the number of certain type blocks as inner blocks? |
Looks like not: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/button/block.json#L7 |
Fixes #
Proposed changes
Buttons → Button
block, gaining all improvements made upstream and a more intuitive editing experience.<button type="submit">
withjetpack-form-submit-button
class).data-wp-class--is-submitting
&data-wp-bind--aria-disabled
so the Core Button integrates with Jetpack Forms’ submit/disable logic.::after
pseudo-element (no extra markup).wp-block-jetpack-button
remain intact.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions
Existing post smoke-test
New form
Variations
Editor layout