Block Editor: Select on Enter in the Block Inserter – So Good!

Block Editor Select On Enter So Good Image

This should be baked into the Gutenberg Block Editor by default. I almost get annoyed anytime I’m working on a site without it. Save yourself some clicks, honey!

What it does…

In the Block Editor’s Block Inserter popup, when you’re typing to find a block and insert it, just hit enter and this script will auto select the first block. Hit enter again and the block will be inserted. So frickin handy.

Why it does it…

There’s just no reason to have to reach for the mouse after you’ve typed and found the block you want. Seriously, why is this not in the Block Editor already?

How it does it…

This uses javascript to check if you are typing inside the Block Search, and if so it enables the Enter key to move focus and trigger inserting blocks.

Use the JSON file for easily importing into your CodeSnippetsPro plugin. Use the PHP file or just copy/paste the code sample into your functions.php if you’re not using CodeSnippetsPro.

Related Snips

Leave a Reply

Your email address will not be published. Required fields are marked *