Copy&Paste breaks layout

Created on 29 February 2024, 9 months ago
Updated 14 June 2024, 5 months ago

Problem/Motivation

When I paste a portion of text into any of the layout regions, the whole region div is replaced by the pasted content.

Steps to reproduce

  1. Create a new page
  2. Write a headline and a paragraph and copy it
  3. Insert a layout into ckeditor
  4. Place cursor into one of the layout regions
  5. Paste the copied content

Proposed resolution

Pasting content should not touch the layout region div.

🐛 Bug report
Status

Fixed

Version

2.0

Component

User interface

Created by

🇩🇪Germany mee_sha

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

Comments & Activities

  • Issue created by @mee_sha
  • 🇩🇪Germany mee_sha

    Additional experience:
    Let's assume, the inserted layout source code looks like this:

    <div class="layout two-col">
    <div class="region-left">
    </div>
    <div class="region-right">
    </div>
    </div>

    When I paste content encapsulated with only one html tag (like <p>Content</p>) into the left region, it works as supposed, disregarding that the surrounding p tag ist stripped. Result:

    <div class="layout two-col">
    <div class="region-left">
    Content
    </div>
    <div class="region-right">
    </div>
    </div>

    If the pasted content hast two html tags (like <h2>Headline</h2><p>Content</p>), the content of the first tag is inserted into the intended layout region, the content of the second is inserted after and outside of that region. Result:

    <div class="layout two-col">
    <div class="region-left">
    Headline
    </div>
    Content
    <div class="region-right">
    </div>
    </div>
  • Status changed to Fixed 6 months ago
  • 🇳🇱Netherlands ricovandevin

    The CKEditor 5 plugin for CKEditor Layouts has been rewritten in 2.1.0. After this rewrite I cannot reproduce this issue. Also, in the first scenario to P tag is preserved now.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024