-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Form: Convert Form block settings to ToolsPanel #70253
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
Form: Convert Form block settings to ToolsPanel #70253
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Thanks for the PR!
I've left some feedback, but please remember that the reset action changes the attribute to its "default value".
…fault attribute values
Hi @t-hamano, Thank you for the fooedbacks. I have made the necessery changes please review the PR at your convenience. |
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.
LGTM! Finally, it would be good to make the following change to avoid a browser warning when changing the "Email for form submissions" field:
diff --git a/packages/block-library/src/form/edit.js b/packages/block-library/src/form/edit.js
index 7d7249f892..13f7086eb3 100644
--- a/packages/block-library/src/form/edit.js
+++ b/packages/block-library/src/form/edit.js
@@ -155,7 +155,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
__next40pxDefaultSize
autoComplete="off"
label={ __( 'Email for form submissions' ) }
- value={ email }
+ value={ email || '' }
required
onChange={ ( value ) => {
setAttributes( { email: value } );
d3f883df2cf66d0d57bba3542f5194f1.mp4
Hi @t-hamano, I have made the changes and after testing the error form console is gone 🎉 Screencast:Screen.Recording.2025-05-30.at.6.14.57.PM.mov |
* Enhance form settings with ToolsPanel for improved submission method management * Refactor email handling in form edit component to use empty string as default value * Refactor form edit component to use ToolsPanel dropdown and update default attribute values * Fix email input default value to empty string in form edit component Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
What?
Refactors the Form block's settings panel to use
ToolsPanel
instead ofPanelBody
.Closes #70242
Why?
This change updates the Form block to align with the ongoing effort to standardize block inspector controls across Gutenberg using the ToolsPanel component. Leveraging ToolsPanel enhances the user experience by introducing reset functionality, improved control organization, and consistent UI patterns across all blocks.
Testing Instructions
Blocks: add Form and input blocks
is turned ONScreenshots