Skip to content

Pasting block in nested blocks fields adds block twice #7093

@SebastianEberlein-JUNO

Description

@SebastianEberlein-JUNO

Description

In a nested blocks fields, pasting a block can result in two blocks being added, under these conditions:

  1. The same block name is used in both the parent and the child blocks field.
  2. The block in the nested blocks field is selected, then copied and pasted using CMD+V.

When using the pasteboard, the block is only added once.

See video:

nested-blocks-copy-paste.mp4

To reproduce

In the plainkit, add these two blueprints. The article block is used both in the main blocks field as well as the two column block.

# site/blueprints/blocks/article.yml
name: Article
wysiwyg: true
preview: fields
fields:
  text:
    type: writer
# site/blueprints/pages/default.yml
title: Default Page

fields:
  blocks:
    type: blocks
    fieldsets:
      article: blocks/article

      twocol:
        name: Two Columns
        wysiwyg: true
        preview: fields
        fields:
          blocksLeft:
            type: blocks
            width: 1/2
            fieldsets:
              article: blocks/article
          blocksRight:
            type: blocks
            width: 1/2
            fieldsets:
              article: blocks/article

Your setup

Kirby Version
4.7.0

Your system
Chrome 134 on macOS 15.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions