-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Show the default style variation if none provided #24217
Conversation
Size Change: +1 B Total Size: 1.16 MB
ℹ️ View Unchanged
|
I need to be those requested changes |
@StefanXhunga I'm not sure I understand your message? |
@@ -110,18 +110,21 @@ function BlockStyles( { | |||
return null; | |||
} | |||
|
|||
if ( ! type.styles && ! find( styles, 'isDefault' ) ) { |
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.
Looks like you already knew it two years ago :) https://github.com/WordPress/gutenberg/pull/12519/files#r240045926
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.
Ah, so what happened was that by setting []
as default for styles
, the !type.styles
was no longer true. 👍
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.
closes #24147
The logic to add default style variations was only checking the "blockType.styles" property and not the registered styles.
Testing instructions