Opened 6 years ago

Closed 6 years ago

#10644 closed Bug (fixed)

Pasting unstyled text in Inline mode using Chrome

Reported by: Tobias Hößl Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.1.3
Component: Core : Pasting Version: 4.2
Keywords: Chrome Cc:

Description

There seems to be a problem with pasting raw text having multiple lines into an inline editor when using Google Chrome (28). The content is inserted, but is invisible and not editable. For example, when I paste

Line 1
Line 2

as raw text into the "Inline Editing by Code" sample of the current Major head (I've installed it at http://animexx.onlinewelten.com/ckeditor-test/samples/inlinebycode.html), the following HTML code is inserted:

<div id="cke_pastebin" style="position: absolute; top: -231px; width: 1px; height: 944px; overflow: hidden; margin: 0px; padding: 0px; left: -1000px;" class="cke_editable">Line 1</div> <div id="cke_pastebin" style="position: absolute; top: -231px; width: 1px; height: 944px; overflow: hidden; margin: 0px; padding: 0px; left: -1000px;" class="cke_editable">Line 2</div>

The problem does not appear when copy/pasting from a website or an word processing program like Word/Openoffice or when only a single line of text is pasted.

Change History (9)

comment:1 Changed 6 years ago by Tobias Hößl

I forgot to mention: this is not new to 4.2 - I also experienced similar behavior in 4.1.2.

comment:2 Changed 6 years ago by Piotrek Koszuliński

Status: newconfirmed

Argh... another bug in Chrome ;|

comment:3 Changed 6 years ago by Piotrek Koszuliński

Each line of text is pasted with those attributes:

<div id="cke_pastebin" style="position: absolute; top: -246px; width: 1px; height: 651px; overflow: hidden; margin: 0px; padding: 0px; left: -1000px;" class="cke_editable">line 2</div>

These attributes (even ID!) are inherited from a pastebin (container into which pasting happens).

comment:4 Changed 6 years ago by Piotrek Koszuliński

Reported: https://code.google.com/p/chromium/issues/detail?id=261205

Let's hope that it will be fixed soon, because the patch on our side may be very hard to create.

comment:5 Changed 6 years ago by Frederico Caldeira Knabben

I've pushed a "research" fix to t/10644 @cksource.

I'm simply using the body element for the pastebin, instead of div. This fixes the pasting, but it makes the inline editor toolbar to "jump" on paste.

We may now try to figure out what to do with this side-effect. Hopefully there is a simple way for it.

comment:6 Changed 6 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedreview

I pushed one more commit, bringing back the code choosing offsetParent for the pastebin. Everything seems to be fine now.

comment:7 Changed 6 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:8 Changed 6 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.1.3

comment:9 Changed 6 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:1baa4c5.

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