mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-14 16:49:10 +02:00
feat(chat): add Ctrl+Enter shortcut to send messages
Allows users to send messages using Ctrl+Enter (or Cmd+Enter on Mac) in addition to the existing Enter key shortcut.
This commit is contained in:
@@ -216,8 +216,11 @@ export const MentionEditor = forwardRef<
|
||||
"prose prose-sm max-w-none focus:outline-none min-h-[2rem] px-3 py-1.5",
|
||||
},
|
||||
handleKeyDown: (view, event) => {
|
||||
// Submit on Enter (without Shift)
|
||||
if (event.key === "Enter" && !event.shiftKey) {
|
||||
// Submit on Enter (without Shift) or Ctrl/Cmd+Enter
|
||||
if (
|
||||
event.key === "Enter" &&
|
||||
(!event.shiftKey || event.ctrlKey || event.metaKey)
|
||||
) {
|
||||
event.preventDefault();
|
||||
// Get editor from view state
|
||||
const editorInstance = (view as any).editor;
|
||||
|
||||
Reference in New Issue
Block a user