Skip to content

Ctrl+Shift+V / Cmd+Shift_V Paste Without Formatting Shortcut Not Working #2380

@mishenThakshana

Description

@mishenThakshana

Preflight Checklist

  • I agree to follow the Code of Conduct
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug
Ctrl+Shift+V / Cmd+Shift+V (Paste without formatting) shortcut does not work in draw.io Desktop. The
draw.io web editor in the renderer process intercepts the keyboard event before Electron's menu
accelerator (pasteAndMatchStyle role) can handle it. On Windows/Linux, the application menu is set to
null, so the shortcut is never registered at all.

To Reproduce

  1. Copy formatted text from a browser or Word document
  2. Open draw.io Desktop
  3. Double-click a shape to enter text editing mode
  4. Press Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (macOS)
  5. Text is pasted with formatting intact, or nothing happens

Expected behavior
Text should be pasted as plain text without formatting.

draw.io version:
29.6.6

Desktop:

  • OS: Windows 11 / macOS
  • App: draw.io Desktop (Electron)

Root cause
In src/main/electron.js, the Edit menu with { role: 'pasteAndMatchStyle' } is only created for macOS.
Even on macOS, the draw.io web editor's JavaScript event handlers intercept the keypress before
Electron's menu accelerator fires.

Proposed fix
Added a before-input-event listener on mainWindow.webContents that intercepts Ctrl/Cmd+Shift+V at the
Electron level — before the event reaches the renderer — and calls webContents.pasteAndMatchStyle()
directly. This works on all platforms.

Branch with fix: https://github.com/mishenThakshana/drawio-desktop/tree/fix-paste-plain-text-shortcut

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions