Opened 10 years ago
Closed 9 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
- http://sdk.ckeditor.com/samples/draganddrop.html
- In the console:
CKEDITOR.instances.editor1.destroy(); - In the console:
CKEDITOR.inline( 'editor1', { extraPlugins: 'hcard,sourcedialog,justify' } ); - 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)
Change History (11)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
| Status: | new → confirmed |
|---|
comment:3 Changed 10 years ago by
| Milestone: | → CKEditor 4.5.8 |
|---|
comment:4 Changed 10 years ago by
| Owner: | set to Tade0 |
|---|---|
| Status: | confirmed → assigned |
comment:5 Changed 10 years ago by
| Milestone: | CKEditor 4.5.8 → CKEditor 4.5.9 |
|---|
comment:6 Changed 10 years ago by
| Status: | assigned → review |
|---|
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 10 years ago by
| Milestone: | CKEditor 4.5.9 → CKEditor 4.5.10 |
|---|
comment:8 Changed 9 years ago by
| Milestone: | CKEditor 4.5.10 → CKEditor 4.5.11 |
|---|
Moving tickets to the next milestone.
comment:9 Changed 9 years ago by
| Milestone: | CKEditor 4.5.11 → CKEditor 4.6.1 |
|---|
comment:10 Changed 9 years ago by
| Milestone: | CKEditor 4.6.1 → CKEditor 4.6.2 |
|---|
Moving to 4.6.2 minor release, as 4.6.1 is mostly about polishing 4.6.0.
comment:11 Changed 9 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review → closed |
Fixed via pull request to the SDK.

cc