"Add another item" field button is displayed as a modal action

Created on 14 June 2020, about 4 years ago
Updated 18 October 2023, 8 months ago

Problem/Motivation

When a form pops up in a modal window, the form includes a multi-value field and the Claro theme is in use, the "Add Another" buttons are added to the footer of the modal instead of below the input field where it belongs.

Steps to reproduce

  • Enable Claro admin theme and Media/Media Library modules.
  • Add a multi-value field to a media type (image), make sure the field is included in the Media Library form mode.
  • Add a media reference field to a content type which uses the Media Library widget.
  • Create a node of that type and add a new image in the Media Library modal.
  • Note the Add Another button is in the footer of the modal rather than below the relevant field.

Same thing happens in other forms in modals using the Claro theme, such as when the Layout Builder Modal is used for Layout Builder tab.

Proposed resolution

Remove <div class="form-actions"> wrapper from around the {{ button }} in Claro's field-multiple-value-form.html.twig file.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Updated Claro theme's field-multiple-value-form.html.twig file to remove 'form-actions' div wrapper around the button, which was causing the buttons to be moved to the footer when the multi-value form element appeared in a modal.

Original Post

Hi, I'm using Layout Builder Modal + Layout builder admin theme. When I use the default D8 administration theme (seven) everything works fine.

If I enable "Claro" as admin theme I've a bug: I've created a custom block type with a multivalue field. The "Add another item" button related to this field is rendered after the form submit button. This happens only with Claro so I'm reporting this bug here.

The "Add another item" should be near the field, the submit button instead should be on the bottom.

🐛 Bug report
Status

Fixed

Version

11.0 🔥

Component
Claro 

Last updated about 3 hours ago

Created by

🇮🇹Italy FiNeX

Live updates comments and jobs are added and updated live.
  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024