Problem/Motivation

When using paragraphs inside the modal block edit form, the "add new paragraph" button drops to the UI dialog button pane, but the block submit button doesn't. This is confusing to content editors.

Screenshot of modal showing paragraph button below block submit button

Proposed resolution

To fix this, we can add one line to the modal dialog options to disable drupalAutoButtons. Unfortunately this setting is currently ignored by core, so users will also need to to install a patch from this related issue.

Steps to reproduce

  • Enable Layout builder, Layout builder modal, and Paragraphs
  • Create a custom block type with a Paragraphs field
  • Add/Edit an instance of that block type in Layout Builder

Comments

jayhuskins created an issue. See original summary.

jayhuskins’s picture

Issue summary: View changes
jayhuskins’s picture

StatusFileSize
new875 bytes

Here is a patch that sets drupalAutoButtons to FALSE in the modal dialog options.

jayhuskins’s picture

Status: Active » Needs review
alvarodemendoza’s picture

I've tried with both patches and it didn't worked with Drupal 9.4.8
I found another solution consisting on adding a wrapper div with .form-actions class to the Add Block button and removing the .form-actions wrapper from the Add another item one. This one worked because the drupalAutoButtons functionality searches for that class in order to move the buttons.

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned

Patch #3 applied successfully on Drupal 9.4.3.
The patch not work for me.
Thank you.

jayhuskins’s picture

Issue summary: View changes
jayhuskins’s picture

@guarav-mathur, I tested it again on Drupal 9.4 and the patch still works for me, so I added steps to reproduce to the issue.

jayhuskins’s picture

Issue summary: View changes
jayhuskins’s picture

Issue summary: View changes
jayhuskins’s picture

Status: Needs review » Postponed

Setting this to postponed until this core issue is fixed:
https://www.drupal.org/project/drupal/issues/2793343

jayhuskins’s picture

Status: Postponed » Needs review

The core issue has been fixed, and so this patch can now be evaluated against 11.x.