Opened 3 years ago

Closed 3 years ago

#14339 closed Bug (fixed)

Drag and Drop sample does not work after the editor is destroyed and recreated.

Reported by: Piotr Jasiun Owned by: Tade0
Priority: Normal Milestone: CKEditor 4.6.2
Component: General Version: 4.5.0 Beta
Keywords: Cc:

Description

And it looks like a bug in the CKEditor, not a core.

Steps to reproduce

  1. http://sdk.ckeditor.com/samples/draganddrop.html
  2. In the console: CKEDITOR.instances.editor1.destroy();
  3. In the console: CKEDITOR.inline( 'editor1', { extraPlugins: 'hcard,sourcedialog,justify' } );
  4. Drag any "Contact" to the editor.

Expected result

Drag and drop will work in the normal way, Contact will be inserted.

Actual result

Nothing happen.

In fact, after destroy and recreate, the dragstart event on the contact list is not fired, what is weird, because that event should not be related to the editor instance. What is also interesting I can not attach listener to that event if the editor is not created, because the CKEDITOR.plugins.clipboard is undefined and CKEDITOR.plugins.clipboard.initDragDataTransfer causes error. Also if I add dragstart event on the plugin initialisation it is executed twice.

Other details (browser, OS, CKEditor version, installed plugins)

http://stackoverflow.com/questions/34899462/ckeditor-drag-and-drop-plugin-integration-stops-working-after-editor-instance-is

Change History (11)

comment:1 Changed 3 years ago by Olek Nowodziński

cc

comment:2 Changed 3 years ago by Marek Lewandowski

Status: newconfirmed

comment:3 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.8

comment:4 Changed 3 years ago by Tade0

Owner: set to Tade0
Status: confirmedassigned

comment:5 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.8CKEditor 4.5.9

comment:6 Changed 3 years ago by Tade0

Status: assignedreview

This was a problem with the code in the SDK.

Whenever the last instance of CKE in the page is destroyed, a reset event is fired which wipes all custom data - among other dragstart listeners.

To fix this the event should be attached whenever an instance of CKE is created.

Associated issue: https://github.com/ckeditor/ckeditor-sdk/issues/176

comment:7 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.9CKEditor 4.5.10

comment:8 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.10CKEditor 4.5.11

Moving tickets to the next milestone.

comment:9 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.11CKEditor 4.6.1

comment:10 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.6.1CKEditor 4.6.2

Moving to 4.6.2 minor release, as 4.6.1 is mostly about polishing 4.6.0.

comment:11 Changed 3 years ago by Tomasz Jakut

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