Open 7c00-oracle opened 3 years ago
Hello, I wasn't able to reproduce this issue using our demo with Simple Box widget: https://ckeditor.com/docs/ckeditor4/latest/examples/simplebox.html. Could you compare your code with the one in sample and tell if you can find the error in your implementation?
Downloaded the example linked above and dropped in CKEditor 4.16.0 plugins (4.14.0 used when the issue was wrriten as mentioned above) I don't see the original error but now dragging the plugin removes existing lines of text. This is what I see now.
Hello, I've used the code from this folder and still wasn't able to reproduce your issue. Please, provide a demo using one of the templates below:
Without it we can't find the potential problem.
Try this pen: https://codepen.io/7c00-oracle/pen/ExNjYYX?editors=1010 Forked it from the pen in previous thread. It should show the same behaviour as I pointed out in the video linked above.
Thank you for demo.
I see the problem is caused by enterMode: CKEDITOR.ENTER_DIV
config option - without it everything works fine. However with this option active, all the block widgets (including e.g. Enhanced Image) are misbehaving.
Type of report
Bug
Steps to reproduce
1) Follow the Widget Tutorial https://ckeditor.com/docs/ckeditor4/latest/guide/widget_sdk_tutorial_1.html 2) Type some text in the editor 3) Create a widget instance in the editor 4) Drag the widget using the "move" icon inside the same editor and drop it.
Expected result
Block level widgets can be dragged and dropped without errors.
Actual result
Dropping block level widgets results in error. Uncaught TypeError: Cannot read property 'endContainer' of undefined at Object.isDropRangeAffectedByDragRange (ckeditor.js:16871) at Object.internalDrop (ckeditor.js:16884) at ckeditor.js:16707
Other details
isBlockWidgetDrop@widget/plugin.js does not set the dragRange unlike the drag-drop handler for inline widgets which results in this error.