How to stop overlay opening as default when creating new Block types?

Another fiddly block question (I’m getting into the Blocks field and really loving the step up from Editor) – some block types open the overlay panel on creation eg. video and some don’t eg. heading or text. What controls this? I’ve scanned all the blueprints, js and php files for each but can’t see anything that would do it. Is something in the core responsible? Or have I missed something? It would be nice to control this as some of the custom types I’m making don’t need editing in the overlay (or at all in fact).
Thanks in advance.

There is an @open="open" directive in the Vue templates of those types that open the Drawer.

I’m not sure it does. My .js file for a simple <hr> block opens the draw when added, and it doesn’t have that directive. This (code below) is the simplest I think the blocks’ .js file can be and it still opens the drawer when creating a new one:

panel.plugin("munro/separator-block", { blocks: {
separator: { template: `<hr>` }, }  });

There is already a feature wish on, I think.

1 Like