From 30331970214b863f1cf27ef3eccf94d97d296580 Mon Sep 17 00:00:00 2001 From: Luca Cannarozzo Date: Thu, 28 Dec 2023 23:35:16 +0100 Subject: [PATCH] feat(chat): clear input on save --- src/stories/chat/parts/commentBox.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stories/chat/parts/commentBox.tsx b/src/stories/chat/parts/commentBox.tsx index c32c23b1..6c98922b 100644 --- a/src/stories/chat/parts/commentBox.tsx +++ b/src/stories/chat/parts/commentBox.tsx @@ -59,11 +59,12 @@ export const CommentBox = ({ }: PropsWithChildren) => { const { children, hasInlineMenu, bubbleOptions, author } = props; - const { setEditor, triggerSave } = useChatContext(); + const { editor, setEditor, triggerSave } = useChatContext(); const onKeyDown = (event: ReactKeyboardEvent) => { if ((event.ctrlKey || event.metaKey) && event.key === "Enter") { triggerSave(); + editor?.commands.clearContent(); } };