Prevent browser default drag behavior

prosemirror-view, as best I can tell, will try very hard to add draggable="true" to any node that does not have draggable: false and selectable: false.

I’m seeing:

  1. In ViewDesc.create, if a node has no contentDOM and is draggable, draggable is set to true
  2. In ViewDesc.selectNode, if a node has no contentDOM or is not draggable, draggable is set to true. This covers every node not covered by step one, unless they have a custom node view with a selectNode override
  3. And then in input.ts, the MouseDown handler class checks if there’s a NodeSelection on the target node, and adds draggable="true" if so. So that covers every node that can have a NodeSelection.

This makes it very challenging to override the default browser drag behavior. The default browser drag behavior has some nice things going for it, but also has some downsides (notably, pretty limited control over the actual visual representation of the drag interaction).

So I guess my questions are:

  1. Am I missing something? Is there a way to disable the default browser draggable behavior for a node type?
  2. If not, would it be possible to add support for that?

Does calling preventDefault on dragstart events not do the trick?

:sweat_smile: It sure does! I would have sworn that I actually tried that early on, but probably I had some other issue that I’ve since resolved.

Thanks Marijn, sorry to bother!