-
Notifications
You must be signed in to change notification settings - Fork 804
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
Contact Form Block: Disallow removing Submit/Contact Us Button (or add a way to add it back if removed) #16303
Comments
Had this happen in 3266094-zen. Added it back by copying/pasting via Code Editor from a new Form block. |
In case we'd like to avoid removing the Submit/Contact Us button, we could try the template lock mechanism. |
Unfortunately that's not on a per block basis so locking would mean not being able to edit any of the fields. |
Is there a core Gutenberg issue for extending that to a per block level? |
Or is it possible to register a variation of a button block for cases like this that prevents deletion? |
No unfortunately not, because it's not a specific button issue. It's more a limitation of innerBlocks. It needs an extension to the API in core for this to work. |
I could see other blocks and plugins and perhaps even themes + patterns making use of that. For example, someone wanting to make a suite of patterns or custom blocks that act like patterns for authors on a large site, while protecting certain blocks from being deleted. |
From that perspective outside of the context of inner blocks then on a per block level might make sense. Assuming it's within a specific container. |
Another case encountered in 4056291-zd-woothemes User accidentally removed the Submit button in the editor. It is still displayed on the front end, but it's not doing any action. To fix it, I had to add a new Form Block, switch to the Code Editor, copy the code of the Submit button Ideally, we should not allow the Submit button to be accidentally removed in the Editor since there is no easy and intuitive way for adding it back for the users, without contacting support or having advanced knowledge of the Code Editor and various Blocks' code. |
Got another report here: 4305930-zd-woothemes The workaround mentioned above worked. |
This was also reported in Automattic/wp-calypso#62816 |
@Automattic/jetpack-crew Looking at this issue I'm recording two possible solutions I see for more feedback
The issue I realise with this issue is that the newly added button doesn't submit the form instead it's created with
I'm not certain what kinda effect this might have on performance , also the remove button option is still there but does nothing from the users perspective, this might be confusing to the user. |
This would seem like a better option, since you always need a submit button with a form. Not perfect though, as you point out. I wonder if this may be something worth bringing up to the Gutenberg team. Maybe having the option to have mandatory inner blocks that cannot be removed from a template would be interesting for other block developers? |
It's possible to remove the
Submit/Contact Us
Button inside the Contact form Block. And once that is done, there is no way to add it back as it's not part of the Blocks the Form can have.I noticed this after #15286 was implemented, so pinging @apeatling in case it's something that can be fixed.
Steps to reproduce the issue
Submit/Contact Us
button to select it and then three-dots andRemove
What I expected
Submit/Contact Us
button (maybe remove the entryRemove
in the three-dots menu)Link: https://d.pr/i/opYVpC
OR
Submit/Contact Us
button to the list of Blocks that can be added inside the Contact Form block.Link: https://d.pr/i/PBMchY
What happened instead
Submit/Contact Us
Button Block can be removed as any other block but with no possibility to add it back (unless you edit the code directly by adding<!-- wp:jetpack/button {"element":"button","text":"Contact Us"} /-->
within<!-- wp:jetpack/contact-form --> <!-- /wp:jetpack/contact-form -->
)#user-report https://wordpress.com/it/forums/topic/testo-pulsante-invia/
The text was updated successfully, but these errors were encountered: