Opened 3 years ago

Last modified 2 years ago

#14391 review Bug

[Blink, FF] Alignment/Indentation/Language direction lost when we copy & paste

Reported by: Satya Minnekanti Owned by: kkrzton
Priority: Normal Milestone:
Component: General Version:
Keywords: IBM Cc: chrisgui, Irina

Description

Steps to reproduce

  1. Open nightly build
  2. Type few paragraphs & apply different Alignments(left, center, right, justify)
  3. Select a paragraph with alignment(ex: right), copy it and paste it.

Expected result

Paragraph pasted properly with correct alignment

Actual result

Paragraph pasted with out any alignment.

  1. Type few paragraphs & apply different Indentaions to them
  2. Select a paragraph with Indentation(ex: margin-left:40px;), copy and paste it.

Expected result

Paragraph pasted properly with correct indentation

Actual result

Paragraph pasted with out any indentation.

This is happening across all browsers

Change History (13)

comment:1 Changed 3 years ago by Satya Minnekanti

Same issue happening with Language direction(dir)applied to paragraph

comment:2 in reply to:  description Changed 3 years ago by Satya Minnekanti

Summary: Alignment/Indentation lost when we copy & pasteAlignment/Indentation/Language direction lost when we copy & paste

Replying to satya:

Steps to reproduce

  1. Open nightly build
  2. Type few paragraphs & apply different Alignments(left, center, right, justify)
  3. Select a paragraph with alignment(ex: right), copy it and paste it.

Expected result

Paragraph pasted properly with correct alignment

Actual result

Paragraph pasted with out any alignment.

  1. Type few paragraphs & apply different Indentaions to them
  2. Select a paragraph with Indentation(ex: margin-left:40px;), copy and paste it.

Expected result

Paragraph pasted properly with correct indentation

Actual result

Paragraph pasted with out any indentation.

  1. Type few paragraphs & apply different language direction (ex: dir=rtl) to them
  2. Select a paragraph with RTL Language direction copy and paste it.

Expected result

Paragraph pasted properly with correct language direction

Actual result

Paragraph pasted with out any language direction.

This is happening across all browsers

comment:3 Changed 3 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed
Version: 4.5.7

Results:

  1. Select text with a mouse, copy/paste into same paragraph works.
  2. Select text with a mouse, copy, move cursor to the end of left-aligned paragraph, press enter and paste. There is an issue as paragraph is now left-aligned.
  3. Select paragraph using element's path, copy, move cursor to the end of left-aligned paragraph, press enter and paste. Paragraph is right-aligned.
  4. Select text with a mouse, copy, move cursor to the end of right-aligned paragraph, press enter and paste. Paragraph is right-aligned.

It seems when selecting paragraph with a mouse, only contents are copied or element styles are missed. It also seems it has always worked that way.

After discussing this ticket with m.lewandowski we have decided to close this ticket as duplicate - #14358. Let's continue this topic there.

comment:4 Changed 3 years ago by Marek Lewandowski

Resolution: duplicate
Status: closedreopened

After more analysis I'll reopen this issue, as our paragraph copy handling has some custom logic in there. That makes it different from standard blocks, like headers.

comment:5 Changed 3 years ago by kkrzton

Status: reopenedconfirmed

comment:6 Changed 3 years ago by kkrzton

Owner: set to kkrzton
Status: confirmedassigned

comment:7 Changed 3 years ago by kkrzton

Copying text with set direction (rtl, ltr) does not work only on IE (due to no custom copy/cut handling #14358#comment:8), works on Chrome and FF. Direction is applied to inline span inside paragraph so it is a matter of copying inline elements.

Other styles (alignment, indentation) copying does not work across all browsers as mentioned in description (because are applied to block element and are not copied).

comment:8 Changed 3 years ago by kkrzton

I assume it should work consistently with copy/paste of other elements. So when pasting previously copied block elements (paragraphs, divs):

  • When pasted in new/empty line all block styles are preserved.
  • When pasted inside existing text, copied block styles are removed so pasted text fits in the paragraph in which it was pasted (that's how it works now for other elements).
  • When more than one block element is pasted (e.g. two paragraphs were copied), all block styles are always preserved even when pasting inside existing text. It means it will split existing paragraph into which it was pasted.

comment:9 Changed 3 years ago by kkrzton

Summary: Alignment/Indentation/Language direction lost when we copy & paste[Blink, FF] Alignment/Indentation/Language direction lost when we copy & paste

Due to same reasons as here #14358#comment:8, so basically no custom copy handling in IE, it will be better to also split this task to IE and non-IE browsers so it can be proceed separately.

IE issue #14406.

Last edited 3 years ago by kkrzton (previous) (diff)

comment:10 Changed 3 years ago by kkrzton

Status: assignedreview

Changes in t/14391.

comment:11 Changed 2 years ago by Jakub Ś

#16701 was amrked as duplicate.

comment:12 Changed 2 years ago by Jakub Ś

It seems we have quite a few issues with copy/paste and style loss - #14391, #14406, #10924.

Last edited 2 years ago by Jakub Ś (previous) (diff)

comment:13 Changed 2 years ago by Jakub Ś

NOTE: From what I have checked this particular issue can be reproduced from CKEditor 4.2.0. Copying from earlier editors even into newer versions preserved the alignment.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy