Weird ctrl+drag selection behavior?

I was having a problem where I wanted a node view to drag differently if Ctrl was held or not. When Ctrl was not held, it worked fine, but when Ctrl was held, it didn’t, the entire node view would get copied instead of moved. I eventually remembered that the Ctrl key when held while dropping and dragging a selection, will copy it. I tried it on a plain contentEditable div and surely enough that’s how it worked.

So then I tried not holding Ctrl at the end before dropping. In a regular contentEditable div, this does not cause the selection to be copied. In fact you can see the little cursor changing to a box with a plus when you hold down the control key, and returning to the regular drag cursor when you aren’t.

But in the prosemirror editor, just having held Ctrl as you click seems to forever modify what happens to the content being dragged. It will always get copied. Additionally there is no cursor change to indicate this. Strangely this does not happen if you start holding down Ctrl after clicking, but if you keep holding it as the selection is dropped, it’s not copied as expected.

Is this some limitation of the editor or is this a bug? Also if it can be fixed, would it be possible to allow controlling the behavior (for example: to ignore the browser’s behavior when ctrl+dragging a custom handle).

I think I just misunderstood how this was expected to work (the modifier from the dragstart event is routed to the drop handler). A PR that fixes that would be welcome.

I’ve opened a PR here to discuss the fix (it was not as straightforward as it initially seemed).