Opened 5 years ago

Closed 5 years ago

#12393 closed Bug (wontfix)

setData and destroy functions fail after doing drag&drop of the instance

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

Description

If you drag&drop the CKEDITOR, the instance is broken due to the iframe reloading. Naturally one would expect the setData to repair the CKEDITOR state. Additionally you cannot even destroy the instance in order to recreate it.

Current (high-level) workaround is:

var c = CKEDITOR.instances[name].config;
delete CKEDITOR.instances[name];
$('#cke_' + name).remove();
CKEDITOR.replace(name, c);

This snippet can be used in a "drop" event, but as you see from the code, this fix relies on internal knowledge of the CKEDITOR.

Please make sure that setData() works without the need to destroy and recreate the instance and also properly destroy() the instance when needed.

Change History (1)

comment:1 Changed 5 years ago by Piotrek Koszuliński

Keywords: setData destroy drag drop removed
Resolution: wontfix
Status: newclosed
Version: 4.4.4

The instance must be destroyed before it's detached from DOM. After that there's not much we can do - handling unloaded iframe in entire code base would add a lot complexity to already complex code. Additionally, every solution will reset scroll and selection so editor would need to store them before iframe is unloaded what may not even be possible.

That's why we recommend following workarounds:

  • Destroying editor before it's detached from DOM.
  • Using inline editor or divarea instead of wysiwygarea.
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy