It is true that the widget is destroyed (and reinitialized) during drag and drop, this behavior cannot be avoided.
How do you bind your jQuery component to a widget object? What does your widget definition look like? (This is the object you pass in the editor.widgets.add() call). Do you Widget.setData() / How do you set this jQuery component as widget data?
If you find it difficult to answer these questions, you can simply copy the source code of your widget instance here (open the browser developer tools and find the element with the data-cke-widget-id attribute - do not confuse the source mode with CKEditor view). Paste it with all the content.
Widgets store their data in the data-cke-widget-data HTML attribute. A blind assumption would be that you either did not correctly set the data in the widgets, or when they are gated and then parsed back, it does not process the jQuery object properly. Perhaps you can initialize your jQuery component with widget.definition.init and save the data as a simple object ( Widget.setData )?
You can also see the documentation for the CKEditor widget for more information.
source share