Skip to content

Button Matrix shows wrong collection options in nested M2A fields #243

@joggienl

Description

@joggienl

Extension

Experimental M2A Interface

Describe the Bug

When using the Experimental M2A Interface in nested contexts (M2A field within a drawer opened from another M2A field), the button matrix displays the wrong collection options. The buttons show options from the parent M2A field instead of the current field's configured collections.

To Reproduce

  1. Start a new Directus project: docker run --rm -it directus/directus:11.11.0
  2. Install the Experimental M2A Interface extension from the marketplace
  3. Create collections: block_form, block_grid, block_hero, block_image, block_text, block_button, block_column, page
  4. In page collection:
    • Add a many-to-any relation selecting all block collections
    • Add a Builder (M2A) Button Matrix field below the M2A relation
  5. In block_grid collection:
    • Add a many-to-any relation selecting only block_text and block_image
    • Add a Builder (M2A) Button Matrix field below the M2A relation
  6. Go to content and create a new page (should show 7 buttons correctly)
  7. Click "Block Grid" to open the drawer
  8. Observe the button matrix in the drawer

Expected behavior

The Block Grid drawer should show only 2 buttons for block_text and block_image.

Actual behavior

The Block Grid drawer shows 7 buttons (same as the parent page field), but only the first 2 buttons work functionally. The button labels don't match their actual actions (e.g., clicking "Block Hero" button might create a "Block Text" item).

Additional context

  • The issue only occurs when opening nested M2A fields (M2A field within a drawer/modal opened from another M2A field)
  • After saving the block_grid item and reopening the drawer, the buttons display correctly
  • The button actions work correctly for the number of allowed collections, but the labels are wrong

Directus Version

v11.11.0

Hosting Strategy

Self-Hosted (Docker Image)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions