Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add missing insertParagraph
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Jan 18, 2023
1 parent e500964 commit d00171a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ export function useInputEventProcessor(onSend: () => void): (event: WysiwygEvent

const isKeyboardEvent = event instanceof KeyboardEvent;
const isEnterPress = !isCtrlEnter && isKeyboardEvent && isEnterPressed(event);
const isInsertParagrah = !isCtrlEnter && !isKeyboardEvent && event.inputType === "insertParagraph";
// sendMessage is sent when cmd+enter is pressed
const isSendMessage = isCtrlEnter && !isKeyboardEvent && event.inputType === "sendMessage";

if (isEnterPress || isSendMessage) {
if (isEnterPress || isInsertParagrah || isSendMessage) {
event.stopPropagation?.();
event.preventDefault?.();
onSend();
Expand Down

0 comments on commit d00171a

Please sign in to comment.