-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Adding class in editor to block created with @wordpress/block results in invalid block on editor reload #21897
Comments
It looks like it's a general issue with the order of loading core scripts. |
Could #21887 be a derived from this bug too? |
Nope, it's a different issue. Core blocks aren't affected by the issue I described. |
@gziolo, thanks for the insight. With 'wp-editor' added as a dependency, the block loads without error. Is there a reason 'wp-editor' isn't a dependency by default? I can imagine there being cases to exclude it, but am not familiar enough with the Block API to know. |
@gziolo was there PR for this since it had the in progress label? |
I tried with the latest version of I get the following HTML saved: <!-- wp:create-block/test-block {"className":"is-style-test"} -->
<p class="wp-block-create-block-test-block is-style-test">Test Block – hello from the saved content!</p>
<!-- /wp:create-block/test-block --> It validates every time I refresh. |
Steps to reproduce:
Console error with example class "is-style-test":
This error also occurs if classes are added via styles registered either in the block plugin or a theme.
The text was updated successfully, but these errors were encountered: