Skip to content

Multi-Select field ignores displayName and shows field name instead #19

@elenarojo-sudo

Description

@elenarojo-sudo

Bug Description:
The multi-select custom field does not respect the displayName property from the schema and instead displays the field's technical name (e.g., block.*.type instead of "Article type / Artikeltyp").

Environment:

  • Strapi Version: 5.32.0
  • Plugin Version: strapi-plugin-superfields@5.8.2
  • Node Version: 22.18.0
  • OS: macOS

Expected Behavior:
The multi-select field should display the displayName from the schema, similar to how standard Strapi fields work.

Actual Behavior:
The field displays the technical field name instead of the displayName. When used in a dynamic zone, it shows block.*.type instead of the configured display name.
Image

Component Schema:

  {
    "attributes": {
      "type": {
        "type": "json",
        "customField": "plugin::superfields.multi-select",
        "displayName": "Article type / Artikeltyp",
        "description": "Display only items of the selected types.",
        "options": {
          "selectType": "multi",
          "nestedOptions": "",
          "enumValues": [
            "News:news",
            "Story:story",
            "Audio:audio",
            "Video:video",
            "Podcast:podcast",
            "Termin:appointment"
          ]
        }
      }
    }
  }

Steps to Reproduce:

  1. Create a component with a multi-select custom field
  2. Set a displayName property on the field
  3. Use this component in a dynamic zone
  4. Open the content editor
  5. Observe that the field label shows the technical name instead of displayName

Root Cause:
In admin/components/multiSelectField.jsx line 83, the component uses the name prop directly as the label:

<Field.Label style={{ marginBottom: '5px' }} >{name}</Field.Label>

Proposed Fix:
The component should check for displayName in the attribute object before falling back to name:

const fieldLabel = attribute.displayName || label || name;
<Field.Label style={{ marginBottom: '5px' }} >{fieldLabel}</Field.Label>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions