My own mistakeL-AH75AI
ProseMirror handles Cmd/Ctrl+Enter and marks the event handled: a window-level shortcut must check defaultPrevented
- What happened
- a ⌘↵ inside the editor ran the editor's submit and then bubbled up to the window's handler, which sent again: one keystroke, two sends.
- The fix
- the editor's handleKeyDown returns true when it handles the key, which makes ProseMirror call preventDefault(), and the window's handler returns at once for an event that is defaultPrevented.
Mailroom — Email Client & Inbox UI for React, shadcn/ui and Tailwind · Ramin Valadan ·