Skip to content

Pasting block in nested blocks fields adds block twice #7093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SebastianEberlein-JUNO opened this issue Mar 27, 2025 · 0 comments
Open

Pasting block in nested blocks fields adds block twice #7093

SebastianEberlein-JUNO opened this issue Mar 27, 2025 · 0 comments

Comments

@SebastianEberlein-JUNO
Copy link

SebastianEberlein-JUNO commented Mar 27, 2025

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: https://github.com/user-attachments/assets/462ce54f-985e-4a9b-b2be-753f46460f3a

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant