-
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
[Block Editor]: Fix block variation registration when icon
is an object
and contains transform
scope
#41457
[Block Editor]: Fix block variation registration when icon
is an object
and contains transform
scope
#41457
Conversation
…bject` and contains `transform` scope
c9522bb
to
c89bc01
Compare
packages/block-editor/src/components/block-variation-transforms/index.js
Outdated
Show resolved
Hide resolved
Size Change: +32 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
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.
This fixes the issue. Thanks, Nik!
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.
Thanks for fixing this up @ntsekouras, the code change looks good to me, too!
I noticed that with the testing instructions, the added dashicon based icon button appears to be rendered slightly lower than the other buttons for some reason:
Not a blocker for landing this fix, but could be good for us to look into in a follow-up — I couldn't quite work out why it's sitting lower, but the difference appears to be that the other block icons render an inline svg
and dashicons uses a span
with a ::before
rule. 🤔
…bject` and contains `transform` scope (#41457) * [Block Editor]: Fix block variation registration when `icon` is an `object` and contains `transform` scope * show colors
What?
Fixes: #41453
Introduced in: #40036
Why?
Currently if we register a block variation with an
object
icon
and includetransform
inscope
, there is a check to show onlyicons
in the block variations transform control in inspector controls, which breaks the editor. We don't take into account that theicon
can be anobject
so I updated the code to useBlockIcon
which does and seems a better choice either way for this use case.Testing Instructions
console
and add the below snippetGroup
block and observe that in inspector controls show the variation's icon.Snippet to add in console
Before
before.mov
After
after.mov