From 1f065bcbb22b833554c574ad542d220baeb9ddca Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 2 Oct 2023 16:37:09 +0500 Subject: [PATCH] web: do not show save dialog when Ctrl+S is pressed --- apps/web/src/components/editor/tiptap.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx index 251a45b2e..658175529 100644 --- a/apps/web/src/components/editor/tiptap.tsx +++ b/apps/web/src/components/editor/tiptap.tsx @@ -154,6 +154,10 @@ function TipTap(props: TipTapProps) { const tiptapOptions = useMemo>(() => { return { editorProps: { + handleKeyDown(view, event) { + if ((event.ctrlKey || event.metaKey) && event.key === "s") + event.preventDefault(); + }, handlePaste: (view, event) => { const hasText = event.clipboardData?.types?.some((type) => type.startsWith("text/")