gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Unable to Use isActive with Core/Group Block Variation

Open jethin opened this issue 2 years ago • 3 comments

Issue

I've created a block variation for the core group block and would like to use the "isActive" property so the editor will recognize it. However, it appears that all of the attributes that would trigger isActive -- primarily the layout attributes -- are used by the core group block's own variations. Thus, "isActive" isn't triggered for my block as it has already been assigned to a core group variation earlier in the stack. I would like my block variation to be able to use the default group block layout attributes.

Proposed Solution

It would be great if there was another, more flexible attribute which could be used to 1) trigger "isActive" on group blocks and 2) filter the return value for my block variation. In my case I believe using the "className" string attribute would work well.

[Note: I'm not really a Github user and is my first feature post here -- apologies if I've screwed this up.]

jethin avatar Apr 16 '24 20:04 jethin

@jethin Thanks for reporting the issue. Would you be able to provide some code snippets to demonstrate how it's not working for you right now?

edit: I'm now wondering if it's the same issue as this one - Group block variations not recognized as active.

talldan avatar Apr 17 '24 05:04 talldan

You're right @talldan, it's the same issue as in the thread you cited. I'll plan to close this thread soon and +1 on the other. Thanks for your help -- much appreciated.

jethin avatar Apr 17 '24 12:04 jethin

You're right @talldan, it's the same issue as in the thread you cited. I'll plan to close this thread soon and +1 on the other. Thanks for your help -- much appreciated.

Closing this out, as it seems you’ve followed up on the other issue.

colorful-tones avatar Apr 18 '24 02:04 colorful-tones