WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

Click whitespace to deselect blocks #59770

Open jasmussen opened 8 months ago

jasmussen commented 8 months ago

59646 originally suggested using the Esc key to deselect blocks. The goal here is to have a simple shortcut to do that, the inverse of ⌘A. That however is likely going to present a writing flow challenge, as when you deselect the last block on the page, focus is back on the top of the page.

At the moment, there are only two ways to deselect blocks. One way is to click the top breadcrumb:

block breadcrumb trail in the footer

Another way is to click outside the blocks. GIF showing clicking a gallery item, then clicking the whitespace outside to deselect:

click outside

The problem with that is that in some layouts, an increasing amount of them especially in the site editor, there is no "outside" to click. Shown here, Twenty Twenty-Four with full-page, full-width layouts, where regardless of where in the canvas you click, you'll be selecting a block:

site editor click outside

For those cases, can we make it so clicking the whitespace in the editor UI deselects?

site editor but with red outlines around suggested areas

Depending on what might be feasible, those whitespace areas could be left and right of the document title element.

scruffian commented 8 months ago

Is it necessary for the click on the whitespace to actually deselect the block, or is it sufficient to hide the blue outline and the toolbar?

jasmussen commented 8 months ago

The inspector hotspots may be a poor choice after all, since that's related to the block you have selected, and deselecting there would be jarring. Edit, updated.

But no, this would still be to deselect blocks, that's still something I find necessary when building out my site, and which is tricky in the site editor. For hiding the selection rectangle and block toolbar, #59646 has been updated to explore a path forward there.