web: do not show save dialog when Ctrl+S is pressed

This commit is contained in:
Abdullah Atta
2023-10-02 16:37:09 +05:00
parent 3efdd9505e
commit 1f065bcbb2

View File

@@ -154,6 +154,10 @@ function TipTap(props: TipTapProps) {
const tiptapOptions = useMemo<Partial<TiptapOptions>>(() => {
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/")