SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.29k stars 3.69k forks source link

SortableJS not working in CKEditor #1562

Open daxhns opened 5 years ago

daxhns commented 5 years ago

Problem:

Hello, great plugin, but:

SortableJS does not work inside a CKEditor. :(

We have spent days trying to make it work, with no success. SorableJS simply does not work inside the CKEditor. We are using CKEditor 4. We have tried various approaches, including writing our own plugin for CKEditor that uses SortableJS, but nothing worked so far.

At the same time, jQuery UI works fine inside the CKEditor.

I am providing the JSFiddle example below, with SortableJS working outside the CKEditor, and not working inside, also with equivalent examples with jQuery UI that work.

JSBin/JSFiddle demonstrating the problem:

https://jsfiddle.net/BoldizArt/eqg30vd4/71/

owen-m1 commented 5 years ago

@daxhns I looked at it and am not sure, but it seems that someone else had the same problem and solved it here: https://github.com/SortableJS/Vue.Draggable/issues/222

daxhns commented 5 years ago

Hi, I saw that, it's the same issue but the solution it suggests, using another CKEditor plugin (divarea) does not solve the issue for us. Besides, even if it that would solve the issue, we are unable to use that plugin, since we need to have CKEditor working in the default IFRAME mode, and divarea plugin turns the editor into content editable div.

owen-m1 commented 5 years ago

@daxhns Have you opened an issue in CKEditor about this? I am thinking it is a problem with their editor canceling the move events.

daxhns commented 5 years ago

No, but the fact that sortable with jQuery UI works in CKEditor suggests that drag events are not prevented by CKEditor.

Or maybe jQuery UI and SortableJS listen to the different events, or listen in a different way?

owen-m1 commented 5 years ago

@daxhns Not sure, but I would still open an issue in CKEditor