Problem/Motivation

In my site I have some layouts with regions/slots that only accept one kind of block by configuring the Layout Builder Restrictions module.

I'd like for editor to skip one click and be presented directly with the form of that only block instead of having to choose the only option available.

Steps to reproduce

Configure Layout builder browser and Layout Builder Restrictions to allow only one kind of block in a region. Then try to add a block to that region

Screenshot

Proposed resolution

Add a global setting "Autoselect block when only one option is available".
The implementation can be done in the frontend. When the modal opens and there is only one "js-layout-builder-block-link" in the modal simulate a click.

Remaining tasks

Decide if this is a worthy addition to the module

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rodrigoaguilera created an issue. See original summary.

rodrigoaguilera’s picture

Status: Active » Needs review

Opened a MR to demonstrate better what I want to achieve