Pass drag event to disableDropCursor #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "master"
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?
It's useful to be able to disable the drop cursor conditionally, depending on what kind of thing is being dragged. In my case I wanted to only show the block level (horizontal) drop cursor when an image file is dragged over the editor.
Passing the DragEvent makes this more symmetrical with EditorView.handleDrop.
It may be this wasn't provided in the past because browsers only provided kind/type information on drop, not during the drag, but it seems like that has changed: https://caniuse.com/mdn-api_datatransfer_items
Here's how I'm using it (on all my nodes that have text content):