Red asterisk placed below on Inline entity form - Complex due to claro block

Created on 28 May 2025, 2 days ago

Problem/Motivation

Here is my setup :
- I have a node with a field that reference an other content type.
- I use "Inline entity form - Complex - Table View Mode" widget to be able to create that node into the main node form.
- So when i try to create a new element, it load the node form with ajax.
- i'm using the gin theme.

My issue :
When the form has loaded into the current form, i have my referenced node form with several tabs.
If the tab contains a required field, the tab will display the red asterisk.
The issue is that the asterisk is bellow the label of the tab and not at the top right as expected.

Steps to reproduce

- Configure a node to have a field that reference an other content type
- Configure this other content type to have a form with multiple horizontal tabs.
- Make sure you have a required field into a tab and that the tab should display a red star if any required field in it.
- On the main node, configure the form to use " Inline entity form - Complex - Table View Mode" to be able to create and edit the second content type.
- Create a main node and try to create the secondary node.
- this will load the second form in ajax
- You'll see the red asterisk bellow the tab label instead of at the right.

Proposed resolution

Here is the resulting html :

<a href="#edit-group-content--BTTyY__6X7U">
    <strong class="form-required">Content
        <span class="claro-details__summary-summary"></span>
    </strong>
    <span class="summary"></span>
    <span id="active-horizontal-tab" class="visually-hidden">
        (active tab)
    </span>
</a>

The issue is related to "", this should not be there if there is no summary.
This is related to web/core/themes/claro/js/details.js :

/**
   * Theme override providing a wrapper for summarized details content.
   *
   * @return {string}
   *   The markup for the element that will contain the summarized content.
   */
  Drupal.theme.detailsSummarizedContentWrapper = () =>
    `<span class="claro-details__summary-summary"></span>`;

I'm not entirely sure how to fix it properly.

A quick fix i propose is to use display:inherit on that class instead of display:block.

🐛 Bug report
Status

Active

Version

10.4

Component

Claro theme

Created by

🇧🇪Belgium arwillame Belgium 🇧🇪

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024