Copy&Paste breaks layout

Created on 29 February 2024, 4 months ago
Updated 14 June 2024, 1 day 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 16 days 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.69.0 2024