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

**URL:** <https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640>\
**Category:** Uncategorized\
**Created:** [August 23, 2024, 12:47am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640 "2024-08-23T00:47:28Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [August 23, 2024, 12:47am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/1 "2024-08-23T00:47:28Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [August 23, 2024, 6:22am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/2 "2024-08-23T06:22:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [March 22, 2025, 10:53pm UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/3 "2025-03-22T22:53:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [March 24, 2025, 11:46am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/4 "2025-03-24T11:46:39Z")

</div>

> [@prosed](#):
>
> 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.

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?

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [March 24, 2025, 7:19pm UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/5 "2025-03-24T19:19:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [March 25, 2025, 8:10am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/6 "2025-03-25T08:10:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [March 26, 2025, 1:32am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/7 "2025-03-26T01:32:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [March 26, 2025, 6:46am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/8 "2025-03-26T06:46:01Z")

</div>

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

> <https://github.com/ProseMirror/prosemirror-view/commit/27f1c05d91dfd97ebb72ae879d0fe85df0742db6>
>
> FEATURE: The new \`dragCopies\` prop can be used to configure whether a drag
> event… inside the editor copies or moves content.
> 
> See https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [April 3, 2025, 9:26pm UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/9 "2025-04-03T21:26:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [April 4, 2025, 7:59am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/10 "2025-04-04T07:59:35Z")

</div>

Great. I’ve released it as part of 1.39.0

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [April 2, 2026, 1:23am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/11 "2026-04-02T01:23:24Z")

</div>

Hey @marijn thank you again for implementing this.

We were locked on an old version for a while using a patch-package approach but finally upgraded.

Unfortunately it seems like returning true from `altCopies`doesn’t actually cause the dragged text to be copied. I’m not sure if I’m doing something wrong but it’s a pretty simple function and definitely returning `true`.

Very quick repro with relevant code starting at line 67: [Basic Prosemirror (duplicated) - StackBlitz](https://stackblitz.com/edit/basic-prosemirror-7pmurndc?file=index.ts)

Tested on Kubuntu 24.10.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [April 2, 2026, 6:46am UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/12 "2026-04-02T06:46:37Z")

</div>

The way the code handled falling back to the default behavior was broken, causing it to always do that when the predicate returned false. This patch should help.

> **[Fix dragCopies behavior · 37885965ee](https://code.haverbeke.berlin/prosemirror/prosemirror-view/commit/37885965ee16c663578e5a4ba3cf6355132ad19f)**
>
> FIX: Fix a bug causing \`dragCopies\` to be ignored when it returned false.
> 
> See https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/11

---

<div class="post-metadata">

**Author:** ![prosed](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@prosed](https://discuss.prosemirror.net/u/prosed)\
**Post date:** [April 2, 2026, 11:06pm UTC](https://discuss.prosemirror.net/t/ctrl-drag-drop-clones-content-but-can-that-be-changed-to-alt-drag-drop/6640/13 "2026-04-02T23:06:24Z")

</div>

Thank you @marijn - you’re the best!
