Skip to content

fix: copy shortcut must not swallow the page's default copy#132

Merged
dazzatronus merged 1 commit into
mainfrom
derk/copy-shortcut-guard
Jul 2, 2026
Merged

fix: copy shortcut must not swallow the page's default copy#132
dazzatronus merged 1 commit into
mainfrom
derk/copy-shortcut-guard

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

The document-level Cmd/Ctrl+C handler called preventDefault before checking whether a clip was selected, so while the editor is mounted, host-app text outside editable fields could never be copied. With a clip selected, clip copy also shadowed an active text selection.

Copy is now only intercepted when it will act on a clip: with no selected clip, or with a non-collapsed text selection anywhere in the document, the browser's default copy runs. Because pointer-down on the canvas or timeline natively collapses any existing text selection, selecting a clip always clears stale text selections first — so clip copy behaves exactly as before whenever the user's most recent action was selecting a clip, and a fresh text selection wins otherwise.

Paste interception is unchanged: outside editable fields there is no observable default paste, and editable fields are already exempt.

Verified with 4 new jsdom tests (no clip, clip copy, text selection wins, editable-field exemption); full suite of 1813 tests passes.

@dazzatronus dazzatronus merged commit 182e5ef into main Jul 2, 2026
1 check passed
@dazzatronus dazzatronus deleted the derk/copy-shortcut-guard branch July 2, 2026 09:00
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.12.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant