fix: Ctrl+V paste not working in Firefox (SIMPL-39)#3350
Draft
thabotswana with Copilot wants to merge 2 commits into
Draft
fix: Ctrl+V paste not working in Firefox (SIMPL-39)#3350thabotswana with Copilot wants to merge 2 commits into
thabotswana with Copilot wants to merge 2 commits into
Conversation
In newer Firefox versions, Monaco's `editor.action.clipboardPasteAction` is
never registered because Monaco's clipboard-support detection explicitly
excludes Firefox (`!isFirefox`) and `document.queryCommandSupported('paste')`
returns false (deprecated). The existing Ctrl+V keybinding silently fails.
Add a fallback: after the keybindingRules call, check whether
`editor.action.clipboardPasteAction` was registered; if not, register a
custom implementation with the same ID that uses `navigator.clipboard.readText()`
so the existing keybinding transparently picks it up.
This is guarded by `!window.electron` (browsers only) and only runs when
the built-in action is absent, so Chrome/Safari/Electron behaviour is unchanged.
Co-authored-by: thabotswana <35628116+thabotswana@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix ctrl-v keyboard shortcut for pasting in webapp
fix: Ctrl+V paste not working in Firefox (SIMPL-39)
Mar 2, 2026
|
@mdawaffe can I bug you for a review of this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In recent Firefox versions, Monaco never registers
editor.action.clipboardPasteActionbecause its clipboard-support detection explicitly excludes Firefox (navigator.clipboard && !isFirefox) anddocument.queryCommandSupported('paste')now returnsfalse(deprecated). The existing Ctrl+V keybinding silently fails with "command not found".Changes
lib/note-content-editor.tsx—editorReady: AfteraddKeybindingRules, check whethereditor.action.clipboardPasteActionwas registered. If not, register a fallback under the same ID usingnavigator.clipboard.readText()+editor.executeEdits():Using the same action ID means the existing keybinding rule picks up the fallback transparently. The
!window.electron+ absence-of-action guard ensures Chrome, Safari, and Electron are unaffected.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.