Drop text to the editor

Hi, the ProseMirror is really powerful in how we can customize it and I somehow got to a point where I lost the ability to drop a text to the editor. I cannot drop text within the editor when I drag selected text and drop it somewhere else in the editor. Also I am not able to select a text from an external editor and drop it to the ProseMirror.

Dragging works. I can select text and drop it to an external editor. And I can see view.dragging object when I manually check it in the listener:

document.addEventListener(‘drop’, e => { console.log(self.view.dragging); });

and the view.dragging content looks correct however handleDrop prop in a plugin or view is never called and text is never moved for some reason.

Screenshot from 2020-06-08 21-30-12

Do you have idea why it is so? I must have made some configuration change or schema change that caused it’s not working anymore because the examples work fine. https://prosemirror.net/examples/

Nothing comes to mind. You’ll have to turn off the things you added to see which one causes the problem.

Thanks @marijn, yes I isolated the editor from the rest of the app and it works now. I will continue experimenting to find the cause and to understand why the rest of the app breaks the drag and drop functionality.

I use React and have some components next to the editor draggable using react-dnd so that’s my next best guess what might be happening.

Ok, so the problem is really with react-dnd and the conflict with the native ondrop events https://github.com/react-dnd/react-dnd-html5-backend/issues/7

For anyone having the same problem … the workaround in the linked issue solves and enables using both ProseMirror’s native onDrop events and react-dnd. https://github.com/react-dnd/react-dnd-html5-backend/issues/7