Skip to content

Fix Firefox web Ctrl+V paste regression#3349

Open
Epikaigle wants to merge 5 commits into
Automattic:trunkfrom
Epikaigle:fix/firefox-web-ctrl-v-paste
Open

Fix Firefox web Ctrl+V paste regression#3349
Epikaigle wants to merge 5 commits into
Automattic:trunkfrom
Epikaigle:fix/firefox-web-ctrl-v-paste

Conversation

@Epikaigle

@Epikaigle Epikaigle commented Feb 22, 2026

Copy link
Copy Markdown

Fix

Fixes Firefox web paste regressions in the note editor (#3329).

After #3316, Simplenote re-added Monaco clipboard keybindings in the browser and continued using Monaco’s context menu there. In Firefox web mode, those Monaco clipboard paths are not reliable.

This PR keeps the existing Monaco clipboard behavior for Electron and non-Firefox browsers, but for Firefox web it now:

  • skips the Monaco paste shortcut so Firefox handles Ctrl+V natively
  • disables the Monaco editor context menu so Firefox uses its native clipboard context menu instead

That moves Firefox web back to the browser-native clipboard flow while keeping the current behavior elsewhere.

Test

  1. In Firefox web, focus the note editor and verify Ctrl+V pastes using the browser-native clipboard flow.
  2. In Firefox web, right-click in the editor and verify the browser-native context menu is used instead of Monaco’s context menu.
  3. In Chromium/Electron flows, verify cut/copy/paste shortcuts still work.
  4. Run:
    • npx eslint lib/note-content-editor.tsx lib/utils/platform.ts lib/utils/platform.test.ts
    • npx jest --config=./jest.config.js lib/utils/platform.test.ts
    • make build

Release

RELEASE-NOTES.md was updated with:

Fixed Firefox web paste to use the browser's native clipboard shortcuts and context menu

@mdawaffe mdawaffe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Epikaigle, @thabotswana - neither #3349 (this PR) nor #3350 work for me in Firefox 148.0.2.

The only thing that works for me is to just never do anything for Firefox :) For this PR (#3349), that means always returning false from canUseMonacoPasteShortcut() for Firefox regardless of whether the clipboard API or the paste command is supported.

That browser detection isn't very satisfying, but it's the simplest thing I found that worked. Note that it doesn't help the multiple-paste bug when pasting from the context menu (#3329 (comment))

Do either of you have any other thoughts?

@Epikaigle

Copy link
Copy Markdown
Author

@mdawaffe I updated this PR to take the simpler Firefox-specific approach you suggested.

For Firefox web, canUseMonacoPasteShortcut() now always returns false, so Ctrl+V is handled natively by the browser there regardless of clipboard API / paste command support.

I also disabled the Monaco editor context menu for Firefox web, so right-click paste uses Firefox's native context menu as well. Electron and non-Firefox browsers keep the existing Monaco clipboard behavior.

The current changes are in:

  • lib/utils/platform.ts
  • lib/note-content-editor.tsx
  • lib/utils/platform.test.ts

I reran:

  • npx eslint lib/note-content-editor.tsx lib/utils/platform.ts lib/utils/platform.test.ts
  • npx jest --config=./jest.config.js lib/utils/platform.test.ts
  • make build

I also updated the PR description to match the current behavior.

This is intended to fix the Firefox web clipboard path in the editor. The separate multiple-paste/context-menu behavior mentioned in #3329 may still need confirmation from your Firefox 148.0.2 setup, although this branch now also avoids Monaco's context menu on Firefox web.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants