-
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
Blocks: Register block when invalid value provided for the icon #34350
Conversation
@@ -25,14 +25,13 @@ import { | |||
import { applyFilters } from '@wordpress/hooks'; | |||
import { select, dispatch } from '@wordpress/data'; | |||
import { _x } from '@wordpress/i18n'; | |||
import { blockDefault } from '@wordpress/icons'; |
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.
@youknowriad, would it be fine to remove the dependency on @wordpress/icons
here?
We map block-default
to the same icon anyway:
gutenberg/packages/block-editor/src/components/block-icon/index.js
Lines 13 to 16 in f42fa3a
if ( icon?.src === 'block-default' ) { | |
icon = { | |
src: blockDefault, | |
}; |
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.
Sure, the goal was to illuminate string icons in Gutenberg and it seems we may not be there for a long time still.
d53e92d
to
0977229
Compare
Size Change: -189 B (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
Description
Fixes #18894.
How has this been tested?
I successfully registered and inserted a block with the icon field set to
icon: null
andicon: ''
. I confirmed that the default block icon was used.Types of changes
Bug fix (non-breaking change which fixes an issue). Backward compatibility.
Checklist:
*.native.js
files for terms that need renaming or removal).