Dropcursor won't remove the cursor if default drop event is prevented from custom handler #1385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
I couldn't build a repro because the Glitch doesn't allow to require
prosemirror-dropcursor, but the bug is simple:event.preventDefault(). I do not return anything from this handler.It seems to me that dropcursor should have a kind of "priority" over the default drop handlers. Removing
preventDefault()from my custom handler is possible but perhaps not recommended are you are supposed to call it in drop event handlers when you accept the drop, unless I misunderstand something specific to prosemirror.Returning "true" at the end seems to have no effect.
Does putting your custom plugin after the dropcursor plugin in the extension array help?
It's a custom event handler, defined using
handleDOMEvents, so not a plugin I would have tried that otherwise.Edit: perhaps there is a way to have a plugin to add events to "handleDOMEvents", instead of listeneing to direct events? So we can control the order in which they run more cleanly?
In the meantime I'll probably copy dropcursor in my app and handle the rendering more directly
You can create a plugin with
props: {handleDOMEvents: {...}}