Ctrl+Drag/drop clones content, but can that be changed to Alt+Drag/drop?

I wonder if it’s possible to change this behavior because Alt+Drag/drop seems more in line with general expectations (eg Photoshop)

Is it possible to customize this? Especially without resorting to patch-package?

Using Ctrl for this is the native browser behavior, as well as what similar editors are doing, so I think it’s more reasonable to align with that than with Photoshop. This is not currently configurable.

1 Like

Hey @marijn I just wanted to see if you might be open to this being adjustable. We decided to patch thise ourselves but that’s pretty painful since our project then gets consumed by another.

Even though you’re 100% right that ctrl is the default in Windows, I think the convention of alt key has won out in software more broadly. ComfyUI is another example that comes to mind.

I understand this is pretty niche and isn’t as simple to make configurable as changing a single line unless dragCopyModifier is exported as a let which seems plenty inadvisable.

But I figure it never hurts to ask - or at least, it doesn’t hurt as much as patching things with Yarn Berry.

Both on Windows and Linux, Ctrl seems to be the widely used modifier for this. Could it be that you’re testing on macOS? That indeed seems to use Alt for this (at least, Chrome and Safari agree on that, in their native behavior). I think it may make sense for ProseMirror to use Alt on that platform, and continue to use Ctrl on others. Would that solve your issue?

Thanks for your reply @marijn! I’m actually testing on Windows and Linux. I believe the behavior you described is already the default - ProseMirror handles it in a technically correct way with Alt on macOS and Ctrl elsewhere.

I know Ctrl key is the default for copying text on Windows and Linux, but in my mind the problem is no one really knows that. I didn’t even know if until I encountered it in ProseMirror by surprise.

Alt+drag is a bit more known across applications (but not necessarily text editing.) This is likely because a lot of this software is developed on macOS but then it’s shipped to Windows and Linux with macOS-like keybinds and as a result, at least in my mind, it’s become a sort of defacto standard for creating copies of content, even though technically Ctrl is “correct” on Windows and Linux when editing text.

Personally I never use macOS (and dislike it) but I feel like they kind of won the war on this point.

To play devil’s advocate though, perhaps this is idiosyncratic to my own experience and I’m wrong to assume others have encounted Alt+drag as often as I have. It is more known in image and video work I guess, since macOS was the early leader on those.

On Linux, all the text-editing apps I try (browsers, LibreOffice, Sublime Text, VS Code) use Ctrl, so I think that indeed your expectations are probably different from those of most users.

1 Like

Seems to be the case that it’s a peculiarity of my experience, but I wonder if it might be worth making configurable anyway.

All right. Does this patch look like it’d work for you?

1 Like

Whoops sorry I don’t check in that frequently but yes that looks great!

Great. I’ve released it as part of 1.39.0

1 Like