Opened 11 years ago

Closed 11 years ago

#10274 closed Bug (invalid)

Changing CKEditor container renders CKEditor unusable

Reported by: Chema Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1.1
Keywords: Cc:

Description

After initializing CKEditor, if you switch its container (or parents container for that matter), CKEditor looses all content and becomes unusable. The editor is not able to gain focus again so it's impossible to write on it. The toolbar buttons remain active and clicking on them throws an exception on the console.

I'm attaching a very basic sample to test this.

So far, I've checked on MacOS X 10.7.5 in Chrome and Firefox, and I've verified this happens in 4.1.1 (master) and released versions 4.0 and 3.6

Attachments (1)

test.html (1021 bytes) - added by Chema 11 years ago.
Simple demo to test the bug

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Chema

Attachment: test.html added

Simple demo to test the bug

comment:1 Changed 11 years ago by Chema

I observed that this was related to CKEditor's iframe losing state.

After digging a little bit, it seems that this is related to https://bugzilla.mozilla.org/show_bug.cgi?id=254144 where the comments state that this is "as spec", so webkit suffers from the same issue.

Last edited 11 years ago by Chema (previous) (diff)

comment:2 Changed 11 years ago by Chema

One last comment, if one has access to the moment when the dom element is moved, there's a possible workaround consisting in destroying the editor prior to moving the node, and then creating it again.

To see it working, replace in the attached example the appendChild line for

CKEDITOR.instances.editor1.destroy();
nextContainer.appendChild(editor);
CKEDITOR.replace("editor1");

Maybe a more general workaround could be implemented somehow using this idea...

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

Resolution: invalid
Status: newclosed

CKEditor cannot be moved from one place to another. You should destroy editor in one place and initialize it again in another.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy