You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lack of validation in Gutenberg components is disappointing. I've setup a series of pre-publishing checks for some core blocks but am having an issue related to inner blocks.
Take the core/buttons for example. I have pre-publishing checks that lock post saving until text and a link have been set on a button. This works well but only when used as a parent block. When I use core/buttons as an inner block in a custom block I can't see to get those same pre-publishing checks to work.
A solid example of this would be a great idea.
In addition to this I am using createErrorNotice to give users a heads up that there's an issue with their block. Unfortunately that item is positioned at the top of the content area and isn't in view when a user is working with blocks further down the page. To date I've been unable to find a way to add position: sticky to that notice so it's at least in view, but what I am ultimately trying to figure out is if I can use createErrorNotice or another method to display the block errors right inside the main block container.
So to summarize, my idea would be to create method to run pre-publishing checks regardless of whether or not the block is a parent or innerblock, and to display a message to the user about the error in the block container.
The text was updated successfully, but these errors were encountered:
@ryanwelcher added an example of what I've currently got in place. I'm checking a few items here, and when a check isn't met there's a createErrorNotice as well as a additional error information in a PluginDocumentSettingPanel. Perhaps this would be a good start point that can be expanded upon for a variety of other blocks and checks and made far better for the user.
The lack of validation in Gutenberg components is disappointing. I've setup a series of pre-publishing checks for some core blocks but am having an issue related to inner blocks.
Take the core/buttons for example. I have pre-publishing checks that lock post saving until text and a link have been set on a button. This works well but only when used as a parent block. When I use core/buttons as an inner block in a custom block I can't see to get those same pre-publishing checks to work.
A solid example of this would be a great idea.
In addition to this I am using createErrorNotice to give users a heads up that there's an issue with their block. Unfortunately that item is positioned at the top of the content area and isn't in view when a user is working with blocks further down the page. To date I've been unable to find a way to add position: sticky to that notice so it's at least in view, but what I am ultimately trying to figure out is if I can use createErrorNotice or another method to display the block errors right inside the main block container.
So to summarize, my idea would be to create method to run pre-publishing checks regardless of whether or not the block is a parent or innerblock, and to display a message to the user about the error in the block container.
The text was updated successfully, but these errors were encountered: